Results 1 to 3 of 3

Thread: MySQL/PHP head scratcher

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Old school, like an old fool. Flying Mullet's Avatar
    Join Date
    Apr 2003
    Location
    Napping in a peach tree.
    Posts
    19,185
    Articles
    6
    Blog Entries
    7
    Contributions
    • Former Administrator
    • Former Cid's Knight
    • Former Senior Site Staff

    Default MySQL/PHP head scratcher

    Okay, so I have my website running locally on MySQL and PHP (MySQL version 4.1.12a and PHP version 5.0.4) and everything runs just fine. I just uploaded some new code to the server, which is running MySQL version 4.0.25-standard and PHP version 4.3.10, and my code dies with the following error message:

    <i>mysql_fetch_array(): supplied argument is not a valid MySQL result resource in xxxx.php on line 20</i>

    Here's the code that I'm using:
    <i><font size="1">// set up the database connection
    $<i></i>db = my<i></i>sql_connect("localhost", "username", "password") or die ('I cannot connect to the database because: ' . mysql_error());;
    mysql_se<i></i>lect_db("databasename",$d<i></i>b);

    // query the DB for all characterspells
    $s<i></i>ql = "SELECT `Level`, `Name`, `Description` FROM `characterspell`, `spell` WHERE `Character` = 'Celes' and `SpellName` = `Name` ORDER BY `Level` ";
    $res<i></i>ult = mys<i></i>ql_query($s<i></i>ql);

    // print the database results
    wh<i></i>ile ($my<i></i>row = my<i></i>sql_fetch_array($re<i></i>sult))...</i></font>

    I've checked the documentation for the methods that I'm using and all have been available since PHP version 3 so I would assum eit's not an issue of different versions of PHP. Any ideas?
    Last edited by Flying Mullet; 02-01-2006 at 02:50 PM.
    Figaro Castle

Posting Permissions

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