
August 22nd, 2004, 12:36 PM
|
|
Registered User
|
|
Join Date: Aug 2004
Posts: 1
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
PHP and Mysql Question
Thanks for reading.
What I need is help on how to get the php to if something in Mysql equals empty then do this if it is not empty then do this.
PHP Code:
#Get the players $JOplayer = mysql_query("SELECT * FROM e_players WHERE rid = $rid ORDER BY name"); //Start the Table $bg = 'tablerow1'; echo '<TD vAlign=top align=middle width=120><BR><TABLE class=wrapper cellSpacing=0 cellPadding=0 align=center border=0><TBODY><TR><TD class=tableheader align=left width=120><B>Players</B></TD></TR>'; while($JOquery = mysql_fetch_array($JOplayer)) { $JOname = $JOquery["name"]; //$JOnum = $JOquery_data["Players"]; //if($JOnum == '1'){ //$JOnum = "echo '<TD class=tablerowend>Sorry no players! </TD></TR></TD></TR></TBODY>'"; //}else{ //$JOnum = "echo '<TD class=',$bg,'>',$JOname,' </TD></TR></TD></TR></TBODY>'"; //} $bg = ($bg=='tablerow1' ? 'tablerow2' : 'tablerow1'); #Fill the table with data echo '<TD class=',$bg,'>',$JOname,' </TD></TR></TD></TR></TBODY>'; } echo '</TABLE><BR><BR></BODY></HTML>'; mysql_close($dbh); ?>
I am so lost. I have try alot of ways but can not get it to output the empty way. It works fine if I leave it blank and just echo the results.
Thanks again
Mr.Looney
|