Hello,

I am receiving the following error message that I'm hoping someone can help me with. The error message is

Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in

The application runs fine on Windows XP Pro/MySql 4.0. When I transfer it to a Linux system, unsure of the MySql version, I run into problems. I'm trying to find out the version for the linux server. If it is a version issue, what replacement code can I use for mysql_fetch

Thank you

Sharon

    Probably more like a register_globals problem. #1 cause of headaches when moving boxes. Try echoing the SQL to the screen to see if it looks the way you want.

    The error itself is saying there's a problem with the query or the connection, or that you just told it to fetch the wrong thing. Post some code, we'll see what we can work with.

      echo out the query and examine it, try it in phpmyadmin. maybe the mysql connection parameters (dbuser, pw, name, host) are different on the linux machine?

        Thanks for the quick response. Here is the code I'm using and its fully functional on MySql 4.O/Windows XP. The Linux server is running MySlq 3.2. I got the code from web monkey. Is there another reference site where I could get code. I've also tried using PHP Code Genie but I run into error messages with that one. I'm still trying to learn PHPMyAdmin

        =========================================
        <?php

        $db = mysql_connect("localhost", "root");

        mysql_select_db("aralib",$db);

        $result = mysql_query("SELECT * FROM staff ",$db);

        echo "<table border=1 width=640>\n";

        echo "<tr><td>Name</td>
        <td>Title</td>
        <td>Phone</td>
        <td>Fax</td>
        <td>Email</td></tr>\n";

        while ($myrow = mysql_fetch_row($result)) {

        	printf("<tr><td>%s %s</td>
        	<td>%s</td>
        	<td>%s</td>
        	<td>%s</td>
        	<td>%s</td></tr>\n",
        	$myrow[1], $myrow[2], $myrow[4], $myrow[6], $myrow[8], $myrow[3]);

        }

        echo "</table>\n";

        ?>

          Write a Reply...