$server = "xxxxxxx";
$username = "xxxxxx";
$password = "xxxxxx";
$dbname = "xxxxxx";
$conn = new mysqli($server, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$query = "SELECT * FROM Figli WHERE idgenitore = $idgenitore";
$result = mysqli_query($conn, $query) or die ("Error in query: $query. ".mysql_error());
while ($rows = mysql_fetch_array($result))
{
//do stuff
}
当我使用mysql_query($ query)时一切都很好,当我迁移到mysqli时问题开始了,现在我有了 “查询错误:SELECT * FROM Figli WHERE idgenitore = admin。”