Hi all,

Given that the resultset from a mysql query is a 2-d array (of sorts - I
don't know), if I retrieve only a single column, is there an easy way to
grab it as a linear array? For example - old way:

$uids=array();
$res = mysql_db_query("db", 'select uid from tbl;', $link);
while ($row = mysql_fetch_row($res)) {
    array_push ($uids, $row[0]);
}

It seems a little redundant to make another array if one already exists. The
end idea is to get to a list of uids ($uid_str = join(',',$uids)) that can
be used in a second query to the db (to make up for the lack of subqueries
in mysql). I guess what I'm asking - can you do a join on the mysql
resultset array somehow. I know in the perl DBI you can get a column of
results, but can't find it in php.

Thx.

J

--
Julian Wood
Learning Technologies and Digital Media
University of Calgary



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to