我很难找到空 mysql 查询的简单解决方案。我想要的是检索到的空行,默认情况下替换为“no-image.png”。如果我的代码看起来像这样,我将如何处理?
$query="SELECT
venues.*
LEFT JOIN events
ON events.VENUE_LOCATION = venues.ID
where events.VENUE_LOCATION IS NULL
ORDER BY VENUE_NAME";
$result = mysql_query($query) or die(mysql_error());
while($row = mysql_fetch_assoc($result)){
echo "<td><IMG src=\"" . $row['IMAGE_URL'] . "\"></td>";
}