Displaying message when no results found in PHP MySQL search

前端 未结 8 1960
独厮守ぢ
独厮守ぢ 2020-12-11 07:07

I have a PHP search script which queries a MySQL database. Currently, when no results are displayed the script shows and error. How can I make it display a message like \"No

8条回答
  •  旧时难觅i
    2020-12-11 07:18

     0){
            while ($row=mysql_fetch_assoc($searchResult)){
                $results[]="
    {$row['description']}
    {$row['url']}
    "; } echo implode($results); } else{ echo 'No Results were found'; } } ?>

提交回复
热议问题