Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-18-2008, 05:36 AM   PM User | #1
gilgalbiblewhee
Regular Coder

 
Join Date: Mar 2005
Posts: 735
Thanks: 4
Thanked 1 Time in 1 Post
gilgalbiblewhee is an unknown quantity at this point
Why doesn't fetch_array work on a remote server?

It works on a local server but not on a remote.
Quote:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in e:\vhosts\...\files\getTableContents.php on line 15
gilgalbiblewhee is offline   Reply With Quote
Old 04-18-2008, 05:40 AM   PM User | #2
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Your query could be failing but you don't know because you aren't doing any error checking?
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Old 04-18-2008, 05:47 AM   PM User | #3
gilgalbiblewhee
Regular Coder

 
Join Date: Mar 2005
Posts: 735
Thanks: 4
Thanked 1 Time in 1 Post
gilgalbiblewhee is an unknown quantity at this point
Quote:
Originally Posted by _Aerospace_Eng_ View Post
Your query could be failing but you don't know because you aren't doing any error checking?
Error: No database selected

hmmmm... I guess the next question is how to select a database on a remote server? I have MySQL but I was having a great difficulty with it.
gilgalbiblewhee is offline   Reply With Quote
Old 04-18-2008, 05:56 AM   PM User | #4
_Aerospace_Eng_
Supreme Master coder!


 
_Aerospace_Eng_'s Avatar
 
Join Date: Dec 2004
Location: In a place far, far away...
Posts: 19,293
Thanks: 2
Thanked 1,044 Times in 1,020 Posts
_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light_Aerospace_Eng_ is a glorious beacon of light
Well assuming that you are even connecting to the mysql server properly then mysql_select_db('databasename'); should be all you need. It will use the last successful connection to the database.
__________________
||||If you are getting paid to do a job, don't ask for help on it!||||
_Aerospace_Eng_ is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:14 AM.


Advertisement
Log in to turn off these ads.