James
3
php
我试图运行一个看似简单的if语句,但是,我的PHP技能并不是那么好.
我正在查询来自单个MySQL表的数据,并且我想运行一个语句来检测字段是否为空,如果它不是我希望它显示某些东西,如果是,则不显示任何内容.
另外,我不确定是否可以将它置于回声中?
编辑:************************这是让事情变得简单的代码:
我可能做错了什么.这是我的代码,可以更轻松地解释事情
"if (!$result) {
exit('
Error performing query: ' . mysql_error() . '
');}
//creating the table w/ headers
echo '
...
Retailer Files';// Display each item
while ($row = mysql_fetch_array($result)) {
echo '
...
' . $row['oc_retailer'] .' this is where I want to if statement to go';
}
echo '
';?>'