Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9
This is the forum to discuss the Wrox book PHP and MySQL: Create-Modify-Reuse by Timothy Boronczyk, Martin E. Psinas; ISBN: 9780470192429
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: PHP and MySQL: Create-Modify-Reuse ISBN: 978-0-470-19242-9 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
  #1 (permalink)  
Old November 18th, 2008, 06:41 AM
Registered User
Join Date: Nov 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problems with chapter 1

I have set up the unmodified source code on a couple of systems running PHP 5.2.5 / MySQL 5.x without any problems. Once I try to run in on my web account, a system running PHP 5.2.6 / MySQL 5.x, problem with the users class occur. First a handful of warnings like:

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /<snip>/lib/User.php on line 87

I can get pass these by defining: "IS_ENV_PRODUCTION" as false. I also managed to iron out the second problem, that of an undefined variable: "filter_var($email, FILTER_VALIDATE_EMAIL)". Here I use an ereg().

Then I ran into a halt though. Once I try to register I get a positive: "Thank you for registering. Be sure to verify your account by visiting" but no data is written to the wrox_pending or wrox_user tables. Also, in the accompanying link to verify.php, the UID is always 0. The token is there but: uid=0.

I would be grateful for any pointers, thanks.
  #2 (permalink)  
Old February 12th, 2009, 04:03 AM
Registered User
Join Date: Feb 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts

dear sir, i am also having same problem. Please advice. Please get back to me @ khannaankit@yahoo.com
  #3 (permalink)  
Old April 2nd, 2009, 12:39 PM
Authorized User
Join Date: Jul 2008
Location: Syracuse, NY, USA.
Posts: 12
Thanks: 1
Thanked 1 Time in 1 Post

IS_ENV_PRODUCTION is intended to be set false when you're developing, and then set true when you role your code out into production. Changing that doesn't make the problem go away; it just suppresses the error messages.

It sounds like the code can't find the database tables. Did you remember to create the database and set up the tables as shown in sql/tables.sql?

I suspect that'll fix the problem you're having with filter_var() since then it won't be passing in an empty value.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with Example in Chapter 6 elly BOOK: Professional Crystal Reports for VS.NET 0 March 31st, 2008 03:39 PM
Yet more Chapter 4 problems Putter BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 3 March 28th, 2007 11:37 PM

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