Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | 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 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
Thread Tools Search this Thread Display Modes
  #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.
Reply With Quote
  #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
Reply With Quote
  #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.

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
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

All times are GMT -4. The time now is 03:30 PM.

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