slight problem...
I was formerly running MySQL 3.2.x on a win2k server with PHP 4.06 and now I've switched over to linux, using the same MySQL version and same PHP version -- yet my mysql_fetch_array functions aren't doing their job...
I'll post a whole script just for a full insight as to the context in which I'm using it and what the problem may be.
<?
$query1 = "select @max_id:=MAX(ID) from news";
$result = mysql_db_query($db, $query1);
$query2 = "select * from news where (ID <= @max_id - 15 AND ID >= @max_id - 30)
$result2 = mysql_db_query($db, $query2);
while($row = mysql_fetch_array($result2)) {
$title = $row["title"];
$id = $row["id"];
echo "
+ <a href=$PHPSELF?ID=$id target=self>$title</a><br>
";
}
echo "<br><a href=/index.php?ID=all target=self>More...</a>";
?>
The error is:
Warning: Supplied argument is not a valid MySQL result resource in /var/www/html/rposts.php on line 7
Line 7 turns out to be the mysql_fetch_array function.
Also, the databases are installed fine and permissions are configured properly.
If you've got some help, I'd appreciate what you can give me. Thanks.
-Travis