hey guys,
I have made a database using mysql and php. I have also put in a search option. But what i want is that if the item which is being searched for is not in the databse it should return "Database Not Found". I am not able to execute this.
Please help me on this.

Recommended Answers

All 2 Replies

hey guys,
I have made a database using mysql and php. I have also put in a search option. But what i want is that if the item which is being searched for is not in the databse it should return "Database Not Found". I am not able to execute this.
Please help me on this.

i assume the name of variables to be dat and data

$dat = mysql_query("SELECT * ........."); // the query you used
if(!$data = mysql_fetch_array($dat)){
echo "No results found";
}

IT WORKED!!!!!!!!!!!!!
Thanks a lot...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.