Sometimes in the system where work happens the following errors appear mysql_error() = ""
and mysql_errno() = "0"
, but this happens very rarely.
My code:
// Essa função está dentro de uma class do meu sistema
// Exemplo : $sql = "Call procedure(1)" obs:no meu sistema trabalhamos com procedures
public function executa($sql){
if($query = mysql_query($sql, $this->conn)){
return $query;
}else {
echo mysql_error();
echo "<hr>";
echo mysql_errno();
echo "<hr>";
echo $sql;
die();
}
}
I searched about it and from what I found in MySql documentation when the mysql_errno()
returns 0 means that the query was executed successfully, but if it was successfully executed because it entered the else
of my conditional?