Vidyalelo
MySQL · Q844

MySQL

Programming · MySQL · question 844

Q844

Which of these has a lower memory requirements? mysql_use_result(), mysql_store_result()

A.
mysql_use_result()
Answer
B.
mysql_store_result()
C.
same
D.
machine dependent

Answer: Option A

Solution

Answer: Option A
Solution:
This question is about two MySQL functions: mysql_use_result() and mysql_store_result(). Both functions are used to retrieve results from a query, but they differ in how they handle the data.

* mysql_use_result() fetches data row by row on demand. It doesn't store the entire result set in memory.
* mysql_store_result() retrieves the entire result set and stores it in memory for later use.

So, which one has lower memory requirements?

Since mysql_use_result() only retrieves data when needed, it uses less memory compared to mysql_store_result(), which stores the entire result set.

Therefore, the answer is Option A: mysql_use_result()