Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Mar 2005
    Posts
    735
    Thanks
    4
    Thanked 1 Time in 1 Post

    Why doesn't fetch_array work on a remote server?

    It works on a local server but not on a remote.
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in e:\vhosts\...\files\getTableContents.php on line 15

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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!||||

  • #3
    Regular Coder
    Join Date
    Mar 2005
    Posts
    735
    Thanks
    4
    Thanked 1 Time in 1 Post
    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.

  • #4
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    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!||||


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •