Good evening,
How do I use, do I count the amount of results of a select in the database using PDO?
<?php
ini_set('display_errors', true);
error_reporting(E_ALL);
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type,x-prototype-version,x- requested-with');
include_once("conPDO.php");
$pdo = conectar();
$data = file_get_contents("php://input");
$data = json_decode($data);
$email = $data->email;
$senha = $data->senha;
$login=$pdo->prepare("SELECT * FROM usuarios WHERE email=:email AND senha=:senha");
$login->bindValue("email", $email);
$login->bindValue("senha", $senha);
$login->execute();
$count = $login->fetch(PDO::FETCH_NUM);
print_r($count);