My knowledge level here is like zilch, but please bear with me.
I have a site built in PHP/MySQL that uses the Smarty template engine. There's a registration form that, for some reason, isn't posting the data to the DB. Here's the function:
$u = new H_User;
$u->setFrom($p);
$smarty->assign('user', $u);
$val = $u->validate();
if ($val === true) {
$temp = new H_User;
$temp->orderBy('user_id desc');
$temp->find(true);
$next_id = $temp->user_id + 1;
$u->user_id = $next_id;
$u->user_password = md5($p['user_password']);
$u->user_regdate = mktime();
$u->user_active = 0;
$u->insert();
$hash = md5($u->user_email . $u->user_regdate);
$smarty->assign('hash', $hash);
$smarty->assign('user', $u);
$smarty->assign('registration_complete', true);
$d = new H_Demographic;
$d->setFrom($p);
$d->insert();
How can I figure out what's wrong here? I don't get any PHP errors and I don't know how to get MySQL to display the errors that might indicate what's wrong with that syntax.
MORE INFO AS PER REQUESTS
#
# Table structure for table `user`
#
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
`user_id` mediumint(8) NOT NULL default '0',
`user_active` tinyint(1) default '1',
`username` varchar(25) NOT NULL default '',
`user_password` varchar(32) NOT NULL default '',
`user_session_time` int(11) NOT NULL default '0',
`user_session_page` smallint(5) NOT NULL default '0',
`user_lastvisit` int(11) NOT NULL default '0',
`user_regdate` int(11) NOT NULL default '0',
`user_level` tinyint(4) default '0',
`user_posts` mediumint(8) unsigned NOT NULL default '0',
`user_timezone` decimal(5,2) NOT NULL default '0.00',
`user_style` tinyint(4) default NULL,
`user_lang` varchar(255) default NULL,
`user_dateformat` varchar(14) NOT NULL default 'd M Y H:i',
`user_new_privmsg` smallint(5) unsigned NOT NULL default '0',
`user_unread_privmsg` smallint(5) unsigned NOT NULL default '0',
`user_last_privmsg` int(11) NOT NULL default '0',
`user_emailtime` int(11) default NULL,
`user_viewemail` tinyint(1) default NULL,
`user_attachsig` tinyint(1) default NULL,
`user_allowhtml` tinyint(1) default '1',
`user_allowbbcode` tinyint(1) default '1',
`user_allowsmile` tinyint(1) default '1',
`user_allowavatar` tinyint(1) NOT NULL default '1',
`user_allow_pm` tinyint(1) NOT NULL default '1',
`user_allow_viewonline` tinyint(1) NOT NULL default '1',
`user_notify` tinyint(1) NOT NULL default '1',
`user_notify_pm` tinyint(1) NOT NULL default '0',
`user_popup_pm` tinyint(1) NOT NULL default '0',
`user_rank` int(11) default '0',
`user_avatar` varchar(100) default NULL,
`user_avatar_type` tinyint(4) NOT NULL default '0',
`user_email` varchar(255) default NULL,
`user_icq` varchar(15) default NULL,
`user_website` varchar(100) default NULL,
`user_from` varchar(100) default NULL,
`user_sig` text,
`user_sig_bbcode_uid` varchar(10) default NULL,
`user_aim` varchar(255) default NULL,
`user_yim` varchar(255) default NULL,
`user_msnm` varchar(255) default NULL,
`user_occ` varchar(100) default NULL,
`user_interests` varchar(255) default NULL,
`user_actkey` varchar(32) default NULL,
`user_newpasswd` varchar(32) default NULL,
`first_name` varchar(40) NOT NULL default '',
`last_name` varchar(40) NOT NULL default '',
`level` int(10) unsigned NOT NULL default '0',
`disabled` tinyint(1) NOT NULL default '0',
PRIMARY KEY (`user_id`),
KEY `user_session_time` (`user_session_time`)
) TYPE=MyISAM;