grlayouts Posted March 17, 2007 Share Posted March 17, 2007 why wont it work? echo "$auser ($aid) has same IP address ($ip) as $buser ($bid)<br>"; else { print "blah"; Link to comment https://forums.phpfreaks.com/topic/43108-simple-mistake/ Share on other sites More sharing options...
corillo181 Posted March 17, 2007 Share Posted March 17, 2007 is that all your code? Link to comment https://forums.phpfreaks.com/topic/43108-simple-mistake/#findComment-209374 Share on other sites More sharing options...
Lumio Posted March 17, 2007 Share Posted March 17, 2007 where is the if? Link to comment https://forums.phpfreaks.com/topic/43108-simple-mistake/#findComment-209377 Share on other sites More sharing options...
grlayouts Posted March 17, 2007 Author Share Posted March 17, 2007 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 More sharing options...
Lumio Posted March 17, 2007 Share Posted March 17, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.