architact 25 Junior Poster

this is probably the worst thread ever.

Daniweb has really lost quality in the last couple years.

Hey you know the meaning of SHIT.??? :D

~s.o.s~ is right please spend sometime on http://www.mammasmilk.com/

~s.o.s~ commented: Haha, nice link. :-) +23
architact 25 Junior Poster

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";
}
architact 25 Junior Poster

try

$dat = mysql_query("SELECT * FROM table");
$data = mysql_fetch_array($dat);

do
{
if($data['text']==""){
continue;
}
echo $data['text'];
}
while($data = mysql_fetch_array($dat));

text is the field which you want to check if it is empty or not.

Shanti C commented: smart reply.... +2