Mysql_store_result stores all the results in a single buffer. But at one
time you can only access one row. It is like a array of structures, where
each structure has one row info. And the call to mysql_fetch advances this
rowcount by one. And coming to storing all the results in one char*, it is a
simple loop you can use.

While(fetch from mysql) {
Catch all columns of a row in output bind vars
Append all these to the char * using some delimiter. (actually you don't
need to know the number of rows before hand, you can do a malloc here
itself)
}
Return (char*)

sujay

-----Original Message-----
From: Lefteris Tsintjelis [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 30, 2005 7:13 PM
To: mysql@lists.mysql.com
Subject: How can I access results in a singel dimentional array?

Hi,

Is there an easy way to access directly the results after a SELECT and a
mysql_store_result() into a single dimentional char *array[], given that I
already know the (fields * rows) value? Are the total results stored in a
single buffer or is it done on a per row basis? How does it work?

Thnx,

Lefteris

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to