这很奇怪,查询执行得很好并将数据插入表中,但我受影响的行显示在负数而不是 1。有谁知道为什么会发生这种情况?
连接.php:
<?php
error_reporting(0);
$db = new mysqli('localhost', 'root', 'pass', 'db');
?>
Run Code Online (Sandbox Code Playgroud)
这是主要代码:
<?php
include 'connect.php';
include 'blowfish.php';
if($_POST['email'] == true)
{
if($db -> connect_errno)
{
echo "Could not connect to the database, please try again later...";
}
else
{
$email = $_POST['email'];
$query = "SELECT id FROM users WHERE email = ?";
$statmnt = $db -> prepare($query);
$statmnt-> bind_param("s",$email);
$statmnt-> execute();
$statmnt-> bind_result($result);
$statmnt-> fetch();
$statmnt-> reset();
if($result)
{
$id = $result;
$result = "";
$randomString = generateRandomString(50); …Run Code Online (Sandbox Code Playgroud)