我很清楚以前有人问过这个问题,我很抱歉再次问,但其他人没有针对我的情况回答。我不知道这个 bind_param 有什么问题。这是我的 PHP 的代码:
<?php
$db = new mysqli("localhost", "HIDDEN", "HIDDEN", "HIDDEN");
if ($db->connect_error) {
die("Sorry, there was a problem connecting to our database.");
}
$username = stripslashes(htmlspecialchars($_GET['username']));
$result = $db->prepare("SELECT * FROM messages");
$result->bind_param("s", $username);
$result->execute();
$result = $result->get_result();
while ($r = $result->fetch_row()) {
echo $r[1];
echo "\\";
echo $r[2];
echo "\n";
}
这个 bind_param 有什么问题?很抱歉再次打扰并感谢您的帮助。