如何使用 mysqli_stmt 进行 2 个查询?
如果我用一个查询进行它是否有效,但有两个给我这个错误:
“致命错误:在非对象中调用成员函数 execute()。”
<?
$oConni=new mysqli('localhost', 'user', 'password', 'database');
$cQuery = "SELECT email, firstname, profile_image FROM usersg";
$stmt = $oConni->prepare($cQuery);
$stmt->execute();
$stmt->bind_result($email, $name, $imagen);
$cQuery2 = "SELECT oauth_uid, oauth_token, username, imagen FROM users";
$resul = $oConni->prepare($cQuery2);
$resul->execute();
$resul->bind_result($id, $fich, $nameTwi, $imagenTwi);
echo "<table border='1'>";
while ($stmt->fetch()) {
echo "<tr>
<td>" . $email. "</td>
<td>" . $name. "</td>
<td><img src='".$imagen."' width=40px height=40px></td>
</tr>";
}
echo "</table><p>";
echo "<table border='1'>";
while ($resul->fetch()) {
echo "<tr>
<td>" . $id. "</td>
<td>" . $fich. "</td>
<td>" . $nameTwi. "</td>
<td><img src='".$imagenTwi."' width=40px height=40px></td>
</tr>";
}
echo "</table>";
?>