0

准备好的陈述给我带来了问题。我可以从数据库中读取数据,但无法写入。这是我遇到问题的准备好的声明。没有错误,但代码执行时没有任何反应。谢谢。

 /*Prepared statement option 1*/

    $stmt = mysqli_prepare($con, "INSERT USERS (userEmail, userPassword, userFname, userLname) VALUES (?, ?, ?, ?)");

/*prepared statement option 2*/

    $query = "INSERT INTO users (userEmail, userPassword, userFname, userLname) VALUES (?, ?, ?, ?)";
    $stmt = mysqli_prepare($con, $query);

/绑定语句/

    mysqli_stmt_bind_param($stmt, 'ssss', $userEmail, $userPassword1, $euserFname, $userLname); 

/* execute prepared statement */
    mysqli_stmt_execute($stmt); 

/* close statement and connection */
    mysqli_stmt_close($stmt); 
4

1 回答 1

0

在连接到 mysqli 之前总是有这条线:

mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
于 2013-09-02T13:12:33.377 回答