I use a mysql_affected_rows on a query but it seems to return false even though the query did execute so i’m a bit confused….
This is what i have:
$check = mysql_query("DELETE FROM $table
WHERE name = '".$darray[0]."' AND
password = '".$darray[1]."' AND uid = '$uid'
AND validation = '22'")
or die(mysql_error());
if(mysql_affected_rows($check)>0){
echo 1;
exit;
} else {
echo 'Less than one!';
exit;
}
Any idea why it says less than one – even though my query did actually delete the row ?
mysql_affected_rows()takes the link identifier (i.e., the connection resource), not the result.