Since you're grabbing only one column, you could also use 

$arrayref = selectcol_arrayref($query)

....and then run your foreach loop over @{$arrayref}.

Brian McCain
PageMasters Internet Group


----- Original Message ----- 
From: "chad kellerman" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, October 03, 2002 12:59 PM
Subject: fetchrow_array

Hi everyone,

   I thought $sth->fetchrow_array would do the trick but its not.  I am
using mysql on linux and I have a query:

SELECT hostname FROM tblHost WHERE status="started";

which returns a list of hostnames.  I though the fetchrow_array would
return a array of hostnames but it does not seem to.  It seems to only
return the first hostname unless I put it in a while loop.

  Is there a way that I can grab every hostname from the table into an
array so that I can run soemthing like a foreach on it??

[*snip*]

Reply via email to