请有人向我解释一下我如何调整我的代码来制作它,以便如果 mysql 表中不存在记录/值,它将回显一段文本?谢谢你。
<?php
$reviews_set = get_reviews();
?>
<h3>Latest Reviews</h3>
<?php
while ($reviews = mysql_fetch_array($reviews_set)) {
?>
<div class="prof-content-box" id="reviews">
<div class="message_pic">
<?php echo "<a href=\"profile.php?id={$reviews['from_user_id']}\"><img width=\"50px\" height=\"50px\" src=\"{$prof_photo}\"></a>";?>
<?php echo "<strong>Review from {$reviews['display_name']}:</strong><br /><br/> {$reviews['content']} <br />";
?>