The mysql_unbuffered_query () sends an SQL query to MySQL, without fetching and buffering the result rows. The benefit of using this function is that it saves considerable amount of memory with SQL queries that produce large result sets and you can start working immediately without waiting for the entire sql query to be completed.
(PHP 4 and above)
|query||A SQL query.||Required||String|
|connection||The MySQL connection. Before performing any operation on a MySQL database, it is required to set a connection to the mysql database you want to work with. And this is done by mysql_connect() function. This function takes three parameters, name of the host, username with which you want to perform tasks with the mysql database in question, and password of that user. As soon as a successful connection is established, you can perform the operations on that mysql database. In case, no such connection is found, it will try to create one without any arguments, i.e. mysql_connect() without any parameters. If it fails to connect to a mysql database, it will generate a warning (E_WARNING) but not an error.||Optional||Resource|
Query handle for successful SELECT, SHOW, DESCRIBE, EXPLAIN and other statements (UPDATE, DELETE, DROP, etc,) or FALSE on error.
Value Type : Resource.
<?php $con = mysql_connect("localhost","root","mypass"); $sql = "SELECT * FROM tutorials"; mysql_unbuffered_query($sql,$con); mysql_close($con); ?>