Hey hello everyone,i have a slight problem with my small delete function in php,below is my code
function delete()
{
$q = "DELETE FROM example WHERE **author='frank'";**
$r = mysql_query($q) or die (mysql_error());
if($r)
{
echo 'done';
}
else
{
echo 'not done';
}
}
Now i don't have any author with that name Frank so that means it is not deleting anything from the database but still shows that done msg
I am not sure why????can anyone please help me
mysql_query()returns a STATEMENT HANDLE if the query succeeded, or FALSE if there was an error. A query which does nothing is still considered a successful query, so unless your query has a syntax error or some other database error occurs, you will always get the handle.