-- -- Table structure for table `modx_sponsor_user_info` -- CREATE TABLE `modx_sponsor_user_info` ( `id` int(10) unsigned NOT NULL auto_increment, `status` varchar(50) NOT NULL default 'pending', `accepted` varchar(10) NOT NULL default 'no', `level` varchar(50) NOT NULL, `firstname` varchar(50) NOT NULL, `lastname` varchar(50) NOT NULL, `age` int(10) NOT NULL, `homephone` varchar(50) NOT NULL, `dayphone` varchar(50) NOT NULL, `email` varchar(50) NOT NULL, `address1` varchar(100) NOT NULL, `address2` varchar(100) NOT NULL, `city` varchar(100) NOT NULL, `state` varchar(50) NOT NULL, `zipcode` varchar(50) NOT NULL, `bike` varchar(50) NOT NULL, `number` int(10) NOT NULL, `type` varchar(50) NOT NULL, `class` varchar(50) NOT NULL, `years` int(10) NOT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;
Try commenting out the insert query in your function as well as printing out the array and see if that shows you anything.
<?php
function sponsorInfo( &$fields )
{
// Bring needed resources into scope
global $modx;
$table_name = $modx->getFullTableName( 'sponsor_user_info' );
// Init our array
$dbTable = array(); // key = DB Column; Value = Insert/Update value
// Insert field/value pairs to insert/update in our table
$dbTable['firstname'] = $fields['firstname'];
$dbTable['lastname'] = $fields['lastname'];
$dbTable['age'] = $fields['age'];
$dbTable['homephone'] = $fields['homephone'];
$dbTable['dayphone'] = $fields['dayphone'];
$dbTable['email'] = $fields['email'];
$dbTable['address1'] = $fields['address1'];
$dbTable['address2'] = $fields['address2'];
$dbTable['city'] = $fields['city'];
$dbTable['state'] = $fields['state'];
$dbTable['zipcode'] = $fields[zip'];
$dbTable['bike'] = $fields['bike'];
$dbTable['number'] = $fields['number'];
$dbTable['type'] = $fields['type'];
$dbTable['class'] = $fields['class'];
$dbTable['years'] = $fields['years'];
print_r($dbTable);
// Run the db insert query
// $dbQuery = $modx->db->insert( $dbTable, $table_name);
return true;
}
// Return empty string
return '';
?>
Fixed it and walla everything works like a charm. Thanks everyone for your help.
Thanks for tutorial dospuntocero, it helped.
I know they talked about his before, but I have little to know experience working with PHP/MySQl, so I was hoping someone could explain in more detail how to return the results of the database table so they can be displayed on an actual page of the website. Thanks.
Or do I really need to study MySQL to understand what to do?
Point the url to a delivery script, and store the parameter in a database.I know this doesn’t relate, sorry about that...
Store some form of unique but identifiable URL-ending.
You then provide the custmer with their download link, built from the database entry:
http://www.example.com/cgi-bin/[email protected]
When somescript.cgi is called it looks up the entry in the database, if it exists, open the file from a secret location and print it to the browser. The actual location of the file is never revealed. If the entry doesn’t exist, it’s expired and display your favorite too bad, so sad message...
First off, I love eForm2db...genius! Works perfect for me and what I want to do.
Second, I’ve got some questions...
1.) I get an error when I want to write a name with an apostrophe (ie, "O’Brien") to the database. Any way to fix this or get around it?

$dbQuery = $modx->db->insert( $dbTable, $table_prefix . 'insertTableName' );