mySQL/php question (beginner)
Moderator: General Moderators
mySQL/php question (beginner)
just wanting to check so i know what sort of a load im putting on my sql server...
does mysql_fetch_array() make any calls to the database? or is all the data from the query statement stored by php on the webserver?
does mysql_fetch_array() make any calls to the database? or is all the data from the query statement stored by php on the webserver?
mysql_query performs a query and if it is SELECT,SHOW,EXPLAIN or DESCRIBE it returns a resource identifier, i think this identifies the place in the memory that the result has been saved in. mysql_fetch_array() then finds the data described by the resource identifier and fetches it as an array. This is the best I can judge from reading the manual.
The answer (as always) is: it depends 
php_mysql.c :and 8.4.3.217 mysql_use_result()
php_mysql.c :
Code: Select all
if(use_store == MYSQL_USE_RESULT) {
mysql_result=mysql_use_result(&mysql->conn);
} else {
mysql_result=mysql_store_result(&mysql->conn);
}afaik the only function that uses use_result() is mysql_unbuffered_querymysql_use_result() initiates a result set retrieval but does not actually read the result set into the client like mysql_store_result() does. Instead, each row must be retrieved individually by making calls to mysql_fetch_row().
does "client" refer to the webserver running the php module or the client browser?volka wrote:mysql_use_result() initiates a result set retrieval but does not actually read the result set into the client like mysql_store_result() does. Instead, each row must be retrieved individually by making calls to mysql_fetch_row().