html - Embedded if statement in a PHP generated table -


i have table built php. value in $row[6], $row[7], and/or $row[8] might "none" (not null). when happens, echo blank space. realize take if statement, can't figure out. appreciated! thanks.

while($row = mysql_fetch_row($query)){ echo "<tr>";         echo "<td>  {$row[1]} </td>"; echo "<td>  {$row[2]} </td>"; echo "<td>  {$row[3]} </td>"; echo "<td>  {$row[4]} </td>"; echo "<td>  {$row[5]} </td>"; echo "<td>  {$row[6]} </td>"; echo "<td>  <a href='{$row[7]}'>bluugnome</a>                                <a href='{$row[8]}'>canyoneeringusa</a>         <a href='{$row[9]}'>climb ut</a> </td>"; 

read http://php.net/manual/de/control-structures.if.php if statement. can nest inside while block like

while($row = mysql_fetch_row($query)){   ...   if($row[1] == "none") {     echo "";   }   ... } 

Comments

Popular posts from this blog

javascript - DIV "hiding" when changing dropdown value -

Does Firefox offer AppleScript support to get URL of windows? -

android - How to install packaged app on Firefox for mobile? -