1
The PHP code looks like this:
$con = new PDO(SERVIDOR, USUARIO, SENHA);
$sql = $con->prepare("SELECT COUNT(id) FROM quiz;");
$sql->execute();
$n = $sql->fetchObject();
And the HTML code looks like this:
<h1>0<?= print $n->COUNT(id);?></h1>
and the error that appears: Fatal error: Call to Undefined method Pdostatement::COUNT() in ............
someone could show me the error ?
pq vc n gives an alias for Count that call
print $n->COUNT(id);
is no stranger. Calls of total for example ;)– rray
But how would be the right way to display the result of COUNT ?
– Gabr13l_Alm31da