Jump to content

Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given i


fabiez

Recommended Posts

I can't find what's wrong with the code...

 

<?php

$Sql = "select team1, team2, t1outcome, t2outcome, winner from coupons where user='$User'";

$Result = mysql_query($Sql, $Link);

print "<table cellpadding=0 cellspacing=0 border=0>";

print "<tr>";

print "<td align=left valign=top>     </td>";

print "<td align=left valign=top> </td>";

print "</tr>";

while($Row = mysql_fetch_array($Result)){

 

if($Row[team1] == $Row[winner]){

print "<tr>";

print "<td align=left valign=top>     </td>";

print "<td align=left valign=top><bold>$Row[team1]</bold> - $Row[team2] $Row[t1outcome]-$Row[t2outcome]</td>";

print "</tr>";

} else {

print "<tr>";

print "<td align=left valign=top>     </td>";

print "<td align=left valign=top>$Row[team1] - $Row[team2] $Row[t1outcome]-$Row[t2outcome]</td>";

print "</tr>";

}

 

}

print "</table>";

 

mysql_close($Link);

?>

try this

<?php

mysql_connect('yourserver', 'login', 'password') or die('Can not connect 1');

mysql_select_db('yourdatabase') or die('Can not connect 2');

$sql = mysql_query("select team1, team2, t1outcome, t2outcome, winner from coupons where user='$User'");

 

print "<table cellpadding=0 cellspacing=0 border=0>";

print "<tr>";

print "<td align=left valign=top>     </td>";

print "<td align=left valign=top> </td>";

print "</tr>";

while($Row = mysql_fetch_array($sql)){

 

if($Row[team1] == $Row[winner]){

print "<tr>";

print "<td align=left valign=top>     </td>";

print "<td align=left valign=top><bold>$Row[team1]</bold> - $Row[team2] $Row[t1outcome]-$Row[t2outcome]</td>";

print "</tr>";

} else {

print "<tr>";

print "<td align=left valign=top>     </td>";

print "<td align=left valign=top>$Row[team1] - $Row[team2] $Row[t1outcome]-$Row[t2outcome]</td>";

print "</tr>";

}

 

}

print "</table>";

 

mysql_close($Link);

?>

 

 

just change out the info with yours

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.