我试图弄清楚如果变量为空,如何跳过从
MySQL表中打印一行.例如,我有一张充满信息的表格.我有一个while循环,回应结果.如果变量为空,如何跳过条目?
例如,如果’tweet1’在行中为空,我可以取消回声吗?
MysqL_connect ($DBsever,$DBusername,$DBpass) or die ('I cannot connect to the database becasue: '.MysqL_error()); MysqL_select_db ("$DBname"); $query = MysqL_query("SELECT * FROM $DBtable ORDER BY time"); while ($row = MysqL_fetch_array($query)) { echo "<br /><strong>".$row['time']." ".$row['headline']."</strong><br/>".$row['description']."<br />".$row['story1']." <a href=".$row['link1']." target='_blank'>".$row['link1']."</a> ".$row['tweet1']."<br />";}