Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 28th, 2010, 03: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.
Reply With Quote
  #2 (permalink)  
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...
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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



All times are GMT -4. The time now is 04:18 PM.


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