Wrox Programmer Forums
| 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 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 19th, 2004, 11:20 AM
Registered User
 
Join Date: Jan 2004
Location: , , .
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default list_db.php - Connecting to a MYSQL server

For some strange reason I am getting the following errors:

cbug

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sites/11/list.php on line 11

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/sites/11/list.php on line 12
==> table(s) in cbug

Its displaying ok all databases and tables in each of them and totals of tables.

However it is also trying to list outside my database account:

mysql

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sites/list.php on line 11

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/sites/list.php on line 12
==> table(s) in mysql

rgs_data

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sites/list.php on line 11

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/sites/list.php on line 12
==> table(s) in rgs_data

scripts

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sites/list.php on line 11

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/sites/list.php on line 12
==> table(s) in scripts

tester

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sites/list.php on line 11

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/sites/list.php on line 12
==> table(s) in tester

vpopmail

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sites/list.php on line 11

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/sites/list.php on line 12
==> table(s) in vpopmail

webby

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sites/list.php on line 11

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/sites/list.php on line 12
==> table(s) in webby

webby_site

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/sites/list.php on line 11

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/sites/list.php on line 12
==> table(s) in webby_site

Would this be a server issue?


 
Old February 19th, 2004, 07:21 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It means your queries are failing and returning FALSE instead of a valid resource handle to a result rowset. You can use mysql_error() to get the error text from MySQL -- this should clear up (or at least shed light on) what's wrong with your queries.

  http://www.php.net/mysql_query
  http://www.php.net/mysql_error



Take care,

Nik
http://www.bigaction.org/
 
Old March 2nd, 2004, 03:02 PM
Registered User
 
Join Date: Mar 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Deuce868
Default

I always get these types of errors when my connection string is bad. Double check it very carefully.

 
Old March 3rd, 2004, 08:31 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Typically, people using mysql aren't using connection strings (unless they're using some DB wrapper class, such as PEAR DB.


Take care,

Nik
http://www.bigaction.org/




Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to mysql withh PHP ramon Beginning PHP 1 October 18th, 2008 03:40 PM
Trouble connecting MySQL to PHP nofences84 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 June 14th, 2007 11:21 PM
Connecting mysql to php?? Manu Sharma BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 3 March 5th, 2007 01:40 AM
Connecting To MySQL from PHP AlisP2P MySQL 1 January 4th, 2006 02:27 AM
connecting to mysql using Php webmoron BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 6 August 24th, 2004 04:30 AM





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