For the PHP buffer mode query, as you know, the following example illustrates how to execute a non-buffered query API.
non-Buffered Query method one: mysqli
<?php
$mysqli = new mysqli ("localhost", "My_user", "My_password", "World");
$uresult = $mysqli->query ("SELECT Name from City", Mysqli_use_result);
if ($uresult) {while
($row = $uresult->fetch_assoc ()) {
echo $row [' Name ']. Php_eol
}
}
$uresult->close ();
? >
non-Buffered Query method two: Pdo_mysql
<?php
$pdo = new PDO ("Mysql:host=localhost;dbname=world", ' my_user ', ' my_pass ');
$pdo->setattribute (Pdo::mysql_attr_use_buffered_query, false);
$uresult = $pdo->query ("SELECT Name from City");
if ($uresult) {while
($row = $uresult->fetch (PDO::FETCH_ASSOC)) {
echo $row [' Name ']. Php_eol
}
? >
Non-Buffered Query method three: MySQL
<?php
$conn = mysql_connect ("localhost", "My_user", "My_pass");
$db = mysql_select_db ("World");
$uresult = Mysql_unbuffered_query ("SELECT Name from City");
if ($uresult) {while
($row = Mysql_fetch_assoc ($uresult)) {
echo $row [' Name ']. Php_eol
}
? >
The above is the entire content of this article, I hope to help you learn, but also hope that we support the cloud habitat community.