2
function retornaStatusPesquisa($numeroStatus,$nomePessoa, $nomeTabela){
$query = mysql_query("SELECT COUNT(status) AS valorStatus FROM $nomeTabela WHERE status=$numeroStatus AND nomePessoa='$nomePessoa'");
$contador=mysql_fetch_assoc($query);
return $contador;
}
I’m getting this mistake:
You have an error in your SQL syntax; check the manual that Corresponds to your Mysql server version for the right syntax to use near 'WHERE status=1 AND namePessoa='Joao'' at line 1
It’s probably because of $nomeTabela
, I don’t know why this happens, could give a light?