two MySQL queries in 1 while()
Posted: Sun Nov 03, 2002 4:37 pm
Mission Impossible.
I've never attempted this before so bare with me...
What am i doing wrong? I just figured this is how to do it, but i am getting this...

I've never attempted this before so bare with me...
Code: Select all
<?php
$Link = mysql_connect ($Host, $User, $Password);
$Query = "SELECT * from $TableName order by rank LIMIT 3";
$Result = mysql_db_query ($DBName, $Query, $Link);
$Query2 = "SELECT * from $TableName2 order by rank LIMIT 3";
$Result2 = mysql_db_query ($DBName, $Query2, $Link);
//creating a table...
print ("<table border=0 width="100%" align=left>\n");
//fetch the results from the databas
while ($Row = mysql_fetch_array ($Result) && $Row2 = mysql_fetch_array ($Result2)) {
print ("<tr align=left valign=top>\n");
print ("<td align=left valign=top><font size=1 face=verdana>#$Rowїrank].</td>\n");
print ("<td align=left valign=top><b><font size=1 face=verdana>$Rowїempire](#$Rowїnum])</b></td>\n");
print ("<td align=left valign=top><font size=1 face=verdana>$Row2їtag]</td>\n");
print ("</tr>\n");
}
mysql_close ($Link);
print ("</table>\n");
?>What am i doing wrong? I just figured this is how to do it, but i am getting this...
Line 88 is the while() loop.Warning: Supplied argument is not a valid MySQL result resource in C:\apache\htdocs\_smx.ca\0\gamezone\home.links.php on line 88