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: 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 Search this Thread Display Modes
  #1 (permalink)  
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?


Reply With Quote
  #2 (permalink)  
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/
Reply With Quote
  #3 (permalink)  
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.

Reply With Quote
  #4 (permalink)  
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/
Reply With Quote
Reply


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



All times are GMT -4. The time now is 08:46 PM.


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