StealthRT
07-23-2008, 04:19 AM
Hey all i am trying to figure out what i am doing wrong with this code below:
$query = "SELECT * FROM emppcn WHERE LastName = '$userLastName'";
$result = mysql_query($query);
if (!$result) {die("Query failed! Query text: $query<br>Error: " . mysql_error());}
if($result == ''){
echo "Nothing found";
}else{
echo "FOUND!";
}
mysql_close($link);
It keeps saying FOUND! when it really doesn't.... How do i check for EOF instead of the NULL? I know how to do it in ASP (rst.EOF) but i havent found something like that for PHP...
And help would be great! :)
David
$query = "SELECT * FROM emppcn WHERE LastName = '$userLastName'";
$result = mysql_query($query);
if (!$result) {die("Query failed! Query text: $query<br>Error: " . mysql_error());}
if($result == ''){
echo "Nothing found";
}else{
echo "FOUND!";
}
mysql_close($link);
It keeps saying FOUND! when it really doesn't.... How do i check for EOF instead of the NULL? I know how to do it in ASP (rst.EOF) but i havent found something like that for PHP...
And help would be great! :)
David