Wrox Programmer Forums
|
BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0
This is the forum to discuss the Wrox book Beginning PHP5, Apache, and MySQL Web Development by Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass; ISBN: 9780764579660
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 28th, 2010, 04:23 PM
Registered User
 
Join Date: Feb 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.
 
Old May 19th, 2010, 05:02 AM
Authorized User
 
Join Date: Feb 2010
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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...





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 16 Accessing Database Bruce A Smith BOOK: Beginning Microsoft Visual Basic 2008 ISBN: 978-0-470-19134-7 7 July 12th, 2009 01:19 PM
Chapter 16 Fig 16-11 krsouthern BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 1 July 8th, 2008 12:11 PM
chapter 12/register/user_login airtime373 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 April 7th, 2008 08:14 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.