MySQL table doesn't update, can't find the error message

Posted by mobius1ski on Stack Overflow See other posts from Stack Overflow or by mobius1ski
Published on 2010-03-28T22:31:58Z Indexed on 2010/03/28 23:23 UTC
Read the original article Hit count: 157

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql