my base is: test, my table: user, inside the table I have two users name and password, when I enter the correct name and password for the user to accept a message of success, but I get this message
Connection error SQLSTATE [42S02]: Base table or view not found: 1146 Table 'test.user' does not exist ...
it tells me that the user table does not exist in the database, it tries when it is --- who can give me a solution to this
try{
$base=new PDO('mysql:host=localhost;dbname=prueba','root','');
$base->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$sql="select * from prueba.usuario WHERE usuario= :nom AND contrasena= :contra ";
$resultado=$base->prepare($sql);
$login=htmlentities(addslashes($_POST["nom"]));
$pasword=htmlentities(addslashes($_POST["contra"]));
$resultado->bindValue(":nom", $login);
$resultado->bindValue(":contra", $pasword);
//ejecutamos la funcion sql
$resultado->execute();
$numero_registro=$resultado->rowCount();
if ($numero_registro !=0) {
echo "<h2>Estas Registrado</h2>";
} else {
header("location:diseño_IngresoA1.php");
exit();
}
}catch(Exception $e){
die("Error conexion" . $e->getMessage());
}
?>