BillyBoB Posted January 21, 2007 Share Posted January 21, 2007 i am build a cs based website for a clan but i was wondering how would i do this [code]while($rinfo=mysql_fetch_array($rsql)&&$i!=0) { if($i==4) { echo(" </tr> <tr> "); } if($i==8) { echo(" <tr> "); } echo(" <td width=\"45px\" height=\"64px\"> <center> <a href=\"members.php?id=$rinfo[membersid]\"><img src=\"roster/$rinfo[pic]\" width=\"35px\" height=\"40px\" title=\"$rinfo[name]\"/></a> </center> </td> "); if($i==1) { echo(" </tr> "); } $i--;}[/code]$i is declared in the earlier script but it shows how many ppl are on the roster and im trying to do somin like if $i != 0 then keep going but if it equals 0 then stopbut as of now im getting nothing showing up Link to comment https://forums.phpfreaks.com/topic/35075-some-syntax-help/ Share on other sites More sharing options...
Meep3D Posted January 21, 2007 Share Posted January 21, 2007 I remember PHP being fussy about bracketing. The following may help (but may not). You may want to use an or || instead also.while(($rinfo=mysql_fetch_array($rsql))&&($i!=0)) {You could just change it to...while($rinfo=mysql_fetch_array($rsql)) {Then just put...if ( $i < 1 ) break;...in at the end to cause it to exit the while loop as the first example will only stop if both $i=0 and it's run out of queries for mysql_fetch_array. Link to comment https://forums.phpfreaks.com/topic/35075-some-syntax-help/#findComment-165525 Share on other sites More sharing options...
BillyBoB Posted January 21, 2007 Author Share Posted January 21, 2007 idk it still isnt working :( the link is http://fbi.ds-studios.net Link to comment https://forums.phpfreaks.com/topic/35075-some-syntax-help/#findComment-165529 Share on other sites More sharing options...
BillyBoB Posted January 21, 2007 Author Share Posted January 21, 2007 nvm i got it fixed up now ty for helping me dude Link to comment https://forums.phpfreaks.com/topic/35075-some-syntax-help/#findComment-165531 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.