php - MySQLi prepared statement it is possible to execute a query multiple times -


i wondering if possible use multiple query way? make work easy or other way this? moved on mysqli prepared statement no idea. you

$mysqli = new mysqli('localhost', 'root', '', 'demo');   $stmt = $mysqli -> prepare("select * users id = ?"); $stmt->bind_param('i', $id); $stmt->execute(); $stmt = $stmt->get_result(); while ($row = $stmt->fetch_assoc()) {     //do row }  $stmt->bind_param('i', $id2); $stmt->execute(); $stmt = $stmt->get_result(); while ($row = $stmt->fetch_assoc()) {     //do row } 

$stmt = $stmt->get_result() 

returns mysqli_result , isn't prepared statement anymore, , such cannot multiple queries.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -