Note that there are some explanatory texts on larger screens.

plurals
  1. POMySQL table doesn't update, can't find the error message
    text
    copied!<p>My knowledge level here is like zilch, but please bear with me.</p> <p>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:</p> <pre><code>$u = new H_User; $u-&gt;setFrom($p); $smarty-&gt;assign('user', $u); $val = $u-&gt;validate(); if ($val === true) { $temp = new H_User; $temp-&gt;orderBy('user_id desc'); $temp-&gt;find(true); $next_id = $temp-&gt;user_id + 1; $u-&gt;user_id = $next_id; $u-&gt;user_password = md5($p['user_password']); $u-&gt;user_regdate = mktime(); $u-&gt;user_active = 0; $u-&gt;insert(); $hash = md5($u-&gt;user_email . $u-&gt;user_regdate); $smarty-&gt;assign('hash', $hash); $smarty-&gt;assign('user', $u); $smarty-&gt;assign('registration_complete', true); $d = new H_Demographic; $d-&gt;setFrom($p); $d-&gt;insert(); </code></pre> <p>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. </p> <p>MORE INFO AS PER REQUESTS</p> <pre><code># # 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; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload