Click here to Skip to main content
15,913,854 members
Home / Discussions / Database
   

Database

 
AnswerRe: ADO - SELECT statment Pin
sathish s31-May-06 2:08
sathish s31-May-06 2:08 
AnswerRe: ADO - SELECT statment Pin
sathish s31-May-06 2:11
sathish s31-May-06 2:11 
QuestionBinding Radio Button to datasource Pin
mamathy30-May-06 19:45
mamathy30-May-06 19:45 
AnswerRe: Binding Radio Button to datasource Pin
Paddy Boyd31-May-06 0:18
Paddy Boyd31-May-06 0:18 
AnswerRe: Binding Radio Button to datasource Pin
postmaster@programmingknowledge.com1-Jun-06 11:00
postmaster@programmingknowledge.com1-Jun-06 11:00 
QuestionBlob in 60 seconds [modified] Pin
BeerFizz30-May-06 15:34
BeerFizz30-May-06 15:34 
AnswerRe: Blob in 60 seconds [modified] Pin
BeerFizz31-May-06 1:54
BeerFizz31-May-06 1:54 
AnswerRe: Blob in 60 seconds [modified] Pin
Eric Dahlvang31-May-06 3:19
Eric Dahlvang31-May-06 3:19 
Have you considered mysql_use_result() rather than mysql_store_result()?

DOCUMENTATION
There are two ways for a client to process result sets. One way is to retrieve the entire result set all at once by calling mysql_store_result(). This function acquires from the server all the rows returned by the query and stores them in the client. The second way is for the client to initiate a row-by-row result set retrieval by calling mysql_use_result(). This function initializes the retrieval, but does not actually get any rows from the server.

In both cases, you access rows by calling mysql_fetch_row(). With mysql_store_result(), mysql_fetch_row() accesses rows that have already been fetched from the server. With mysql_use_result(), mysql_fetch_row() actually retrieves the row from the server. Information about the size of the data in each row is available by calling mysql_fetch_lengths().

After you are done with a result set, call mysql_free_result() to free the memory used for it.

The two retrieval mechanisms are complementary. Client programs should choose the approach that is most appropriate for their requirements. In practice, clients tend to use mysql_store_result() more commonly.

An advantage of mysql_store_result() is that because the rows have all been fetched to the client, you not only can access rows sequentially, you can move back and forth in the result set using mysql_data_seek() or mysql_row_seek() to change the current row position within the result set. You can also find out how many rows there are by calling mysql_num_rows(). On the other hand, the memory requirements for mysql_store_result() may be very high for large result sets and you are more likely to encounter out-of-memory conditions.

An advantage of mysql_use_result() is that the client requires less memory for the result set because it maintains only one row at a time (and because there is less allocation overhead, mysql_use_result() can be faster). Disadvantages are that you must process each row quickly to avoid tying up the server, you don't have random access to rows within the result set (you can only access rows sequentially), and you don't know how many rows are in the result set until you have retrieved them all. Furthermore, you must retrieve all the rows even if you determine in mid-retrieval that you've found the information you were looking for.

----------
Some problems are so complex that you have to be highly intelligent and well informed just to be undecided about them.
- Laurence J. Peters

GeneralRe: Blob in 60 seconds [modified] Pin
BeerFizz31-May-06 3:46
BeerFizz31-May-06 3:46 
GeneralRe: Blob in 60 seconds [modified] Pin
Eric Dahlvang31-May-06 5:08
Eric Dahlvang31-May-06 5:08 
GeneralRe: Blob in 60 seconds [modified] Pin
BeerFizz31-May-06 5:30
BeerFizz31-May-06 5:30 
GeneralRe: Blob in 60 seconds [modified] Pin
Eric Dahlvang31-May-06 6:19
Eric Dahlvang31-May-06 6:19 
GeneralRe: Blob in 60 seconds [modified] Pin
BeerFizz31-May-06 6:17
BeerFizz31-May-06 6:17 
QuestionPls Help - Visual C++ with ADO Pin
antonaras30-May-06 5:52
antonaras30-May-06 5:52 
AnswerRe: Pls Help - Visual C++ with ADO [modified] Pin
George L. Jackson30-May-06 11:29
George L. Jackson30-May-06 11:29 
QuestionADO Books Pin
Rajkamal_dfine30-May-06 4:23
Rajkamal_dfine30-May-06 4:23 
QuestionConnection error Pin
Paps230-May-06 3:22
Paps230-May-06 3:22 
AnswerRe: Connection error Pin
Jerry Hammond30-May-06 7:18
Jerry Hammond30-May-06 7:18 
QuestionTrap difference between two records... Pin
deep730-May-06 2:31
deep730-May-06 2:31 
AnswerRe: Trap difference between two records... Pin
Colin Angus Mackay30-May-06 2:47
Colin Angus Mackay30-May-06 2:47 
GeneralRe: Trap difference between two records... Pin
deep730-May-06 18:15
deep730-May-06 18:15 
GeneralRe: Trap difference between two records... Pin
r.stropek4-Jun-06 6:35
r.stropek4-Jun-06 6:35 
QuestionHow to convert the Sql tables to stored procedure Pin
a_n_sowmya30-May-06 0:31
a_n_sowmya30-May-06 0:31 
AnswerRe: How to convert the Sql tables to stored procedure Pin
Colin Angus Mackay30-May-06 2:12
Colin Angus Mackay30-May-06 2:12 
AnswerRe: How to convert the Sql tables to stored procedure Pin
sathish s31-May-06 2:06
sathish s31-May-06 2:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.