PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 22nd, 2004, 12:36 PM
Mr.Looney Mr.Looney is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 Mr.Looney User rank is Just a Lowly Private (1 - 20 Reputation Level) 
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!&nbsp;</TD></TR></TD></TR></TBODY>'";
//}else{
//$JOnum = "echo '<TD class=',$bg,'>',$JOname,'&nbsp;&nbsp;</TD></TR></TD></TR></TBODY>'";
//}
$bg = ($bg=='tablerow1' 'tablerow2' 'tablerow1');
#Fill the table with data
echo '<TD class=',$bg,'>',$JOname,'&nbsp;&nbsp;</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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingPHP Development > PHP and Mysql Question


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT