I have followed instructions from a tutorial, but the following will not return results. I know that the query it is performing does have corresonding values. But, the while $stmt->fetch() loop never gets entered.
Thank you for any insightCode:$host = "#####"; $user="####"; $password="####"; $database="####"; $mysqli = new mysqli($host, $user, $password, $database); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } /* prepare statement */ if ($stmt = $mysqli->prepare("SELECT UserID, UserFirstName FROM User where UserEmail = ?")) { $stmt->bind_param("s",$EmailAddress); $stmt->execute(); /* bind variables to prepared statement */ $stmt->bind_result($col1,$col2); /* fetch values */ while ($stmt->fetch()) { printf("results:%s %s\n", $col1, $col2); } /* close statement */ $stmt->close(); } /* close connection */ $mysqli->close();


Reply With Quote

Bookmarks