データベースから値を取得して値を表示しますが、値を表示して空のメッセージを表示したい場合は、while ループに値がない場合はメッセージを出力します。
これが私のコードです。誰か助けてください。
/* database link */
require_once '../db.php';
$query = "SELECT id,first_name FROM ajax_user";
$result = mysql_query($query,$connection) or die('Could connect !');
/* loop */
while ($row = mysql_fetch_array($result)) {
if($row['first_name']):
echo $row['first_name']; /* no problem print those values */
else:
/* here is the problem, message doesn't print if (ajax_user) */
/* table is empty */
echo 'no value your database !!';
endif;
}