How can I pass the COUNT attribute on my sql string, since "COUNT" is a reserved php word?

0

Follow the select string:

$resultado = mysqli_query($conn, "SELECT COUNT(*) FROM conta WHERE username:usuario AND userpassword:senha";
    
asked by anonymous 28.04.2017 / 18:54

1 answer

0

The count(*) is inside the string, so no problem, to get its value and get more readable too, I suggest assigning an alias to it eg: select count(*) as total from ...

    
01.05.2017 / 15:08