Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5
This is the forum to discuss the Wrox book Beginning PHP4 by Wankyu Choi, Allan Kent, Chris Lea, Ganesh Prasad, Chris Ullman; ISBN: 9780764543647
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 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 June 6th, 2003, 01:29 AM
Registered User
 
Join Date: Jun 2003
Location: Orange County, California, USA.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Not a valid MySQL result resource

Can anyone tell me why the following:
------------------------------------
function in_use($userid) {
global $user_tablename;

$query = "SELECT userid FROM $user_tablename WHERE userid = '$userid'";
$result = mysql_query($query);
if (mysql_num_rows($result)) return 0;
else return 1;
}
----------------------------------------
Returns the following error:

"Warning: mysql_num_rows(): supplied argument is
not a valid MySQL result resource"

This is from the register.php script in chapter 13
on page 469, middle of page.

 -David
Reply With Quote
  #2 (permalink)  
Old June 10th, 2003, 08:01 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , United Kingdom.
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Is that your code verbatim? Or do you have @ in front of mysql_query? I only ask coz I saw this on php.net
Quote:
quote:
you can't use the @ to suppress errors when you would like to use mysql_num_rows on the variable or it will return the following error
Warning: Supplied argument is not a valid MySQL result resource
Reply With Quote
  #3 (permalink)  
Old June 16th, 2003, 11:19 AM
Authorized User
 
Join Date: Jun 2003
Location: Indianapolis, IN, USA.
Posts: 50
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hawkelburry,
Please refer to the following:
http://www.wrox.com/books/errata/076...4_errata.shtml
Reply With Quote
  #4 (permalink)  
Old January 29th, 2009, 09:13 AM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

(1) The link to errata is broken
(2) There is no reference to this error in the errata

This error must be due to the code being out of date with the version of PHP I'm using on my server.

I can see why books require revision and republication and go out of date.

Looks like I have to buy the book again to the latest version.
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
Resource For Controls Muhammad Zeeshan ASP.NET 2.0 Professional 0 July 27th, 2007 05:45 AM
GridView and SQL More than one result = one result DarkForce ASP.NET 2.0 Basics 0 July 20th, 2007 05:29 AM
Calendar as a resource?? kabucek BOOK: Access 2003 VBA Programmer's Reference 0 August 8th, 2006 08:27 AM
resource not available: servlets ejmelious Apache Tomcat 0 May 19th, 2005 12:52 PM
getting a specific row from a MySQL result set Tachyon Beginning PHP 3 July 12th, 2004 12:55 PM



All times are GMT -4. The time now is 02:43 PM.


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