此代码无法正常工作,但我认为一切都正确。 我需要计算一下,如果有0行会踢用户。
<?php
require 'config.php';
$email = $_POST['email'];
$codice = $_POST['codice'];
$password = $_POST['password'];
$stmt = $connect->prepare('SELECT count(*) AS conto FROM primoaccesso WHERE
email = :email AND codice = :codice AND password = :password');
$stmt->execute(array(
':email' => $email,
':codice' => $codice,
':password' => $password
));
$data = $stmt->fetch(PDO::FETCH_ASSOC);
if($data['conto'] == 0){
header('Location: /primoaccesso.php');
}
?>