Jump to content

simple mistake.


grlayouts

Recommended Posts

why wont it work?

 

    
         <?
$sql = "SELECT a.id, a.user, a.ip, b.id, b.user, a.rank
        FROM players a INNER JOIN players b ON a.ip = b.ip
        WHERE a.id < b.id and a.rank !='Admin' and a.rank !='Staff' and a.jail !='21' and a.user !='paws'";
$res = mysql_query($sql) or die (mysql_error().'<p>$sql</p>');
while (list ($aid, $auser, $ip, $bid, $buser) = mysql_fetch_row($res) ) {
else {
print "blah"; ?>

 

Link to comment
https://forums.phpfreaks.com/topic/43108-simple-mistake/#findComment-209378
Share on other sites

while (list ($aid, $auser, $ip, $bid, $buser) = mysql_fetch_row($res) ) {
else {
print "blah";

There is no If-Instruction and also no ending }

try this:

if (mysql_num_rows($res)) {
   while ($row = mysql_fetch_assoc($res)) {
      echo $row['id'].$row['user'].$row['ip'];
   }
}else echo '<i>No result</i>';

Link to comment
https://forums.phpfreaks.com/topic/43108-simple-mistake/#findComment-209391
Share on other sites

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.