Re: Creating an Array from a Recordset
| From: | Jason Wong | Date: | Thu, 06 Feb 2003 14:27:45 +0000 |
| Subject: | Re: Creating an Array from a Recordset | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-134603@lists.php.net to get a copy of this message | ||
On Thursday 06 February 2003 22:04, Vernon wrote:
> I'm trying to create an array from a rocordset that will do somethingt like
> this:
> $datay=array(12,8,19,3,10,5,55,88,3);
>
> the following is the code I have attempted to create, which is not working:
>
> do {
> $dat = ($row_rsCOUNTRY['CountryCount'] & ","
> $row_rsCOUNTRY['CountryCount']);
> } while ($row_rsCOUNTRY = mysql_fetch_assoc($rsCOUNTRY));
>
> $datay=array($dat);
unset($datay); // just in case it is already defined
while ($row_rsCOUNTRY = mysql_fetch_assoc($rsCOUNTRY)) {
$datay[] = $row_rsCOUNTRY['CountryCount'];
}
print_r($datay);
--
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Ma Bell is a mean mother!
*/