I have a V-server by 1and1. Unfortunately the support is not sufficient.
This code is part of a login file and has been working for nearly 1½ year. Since yesterday the execute statement return false.
I have tried different things, but I cannot find out why execute return false ?
$mail = "test";
$password = "test";
$prep = "SELECT id FROM member WHERE address=? AND password=?";
if ( $stmt = $mysqli->prepare($prep))
{
$stmt->bind_param( "ss", $mail, $password );
$stmt->execute();
$stmt->bind_result($id);
if ($stmt->fetch())
..........
When I reduce the SELECT statement and remove AND, the $stmt->execute() returns TRUE.
$mail = "test";
$password = "test";
$prep = "SELECT id FROM member WHERE address=?";
if ( $stmt = $mysqli->prepare($prep))
{
$stmt->bind_param( "s", $mail );
$stmt->execute();
$stmt->bind_result($id);
if ($stmt->fetch())
..........
When I add an AND either an OR it fails again ?
$mail = "test";
$password = "test";
$prep = "SELECT id FROM member WHERE address=? OR password=?";
if ( $stmt = $mysqli->prepare($prep))
{
$stmt->bind_param( "ss", $mail, $password );
$stmt->execute();
$stmt->bind_result($id);
if ($stmt->fetch())
..........