p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 (http://p2p.wrox.com/forumdisplay.php?f=160)
-   -   Chapter 16 'Register' does not write to database (http://p2p.wrox.com/showthread.php?t=78390)

dako3256 February 28th, 2010 04:23 PM

Chapter 16 'Register' does not write to database
 
I am having an issue where if someone registers the information is not being sent to database at all. I've checked the code and can't understand why. I debugged the code and followed it and it seems to skip in transact-user.php at:

case 'Create Account':
if (isset ($_POST['name'])
and isset ($_POST['email'])
and isset ($_POST['passwd'])
and isset ($_POST['passswd2'])
and $_POST['passwd'] == $_POST['passwd2']) {
$sql = "INSERT INTO forum_users " .
"(email, name, passwd, date_joined, last_login) " .
"VALUES ('" . $_POST['email'] . "','" .
$_POST['name'] . "','" . $_POST['passwd'] . "','" .
date("Y-m-d H:i:s", time()). "','" .
date("Y-m-d H:i:s", time()). "')";

mysql_query($sql, $conn)
or die ('Could not create user account; ' . mysql_error());

This is being called from useraccount.php from the $mode = "Create";

Any help would be appreciated.

plugnz May 19th, 2010 05:02 AM

I dont know if this is the reason but you have called up 'passsword2' in the 5th line and then called it 'passwd2' in the 6th.... sometimes it's simple errors like that that really stuffs everything up and then takes for ever to find...


All times are GMT -4. The time now is 10:15 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.