RE: [PHP-DB] getting mysql_fetch_row into array
| From: | Ford, Mike [LSS] | Date: | Tue, 24 Sep 2002 09:46:52 +0000 |
| Subject: | RE: [PHP-DB] getting mysql_fetch_row into array | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-21958@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: LSC Exhibits Department [mailto:LSCEXHIBITS@louky.org]
> Sent: 23 September 2002 18:17
>
> Going through brain-lock here. From this query "Select
> count(deptid) from
> maintenance group by deptid" ,I get 11 rows. What I need to
> do is get an
> array like $a=array(315,11,43,67,415,32,25,63,93,46,76) from
> this query, so
> that
> $a[0]=315
> $a[1]=11
> $a[2]=43
> and so on. The best I can get is ;
> $a[0][0]=315
> $a[0][1]=11
> $a[0][2]=43 and so on. Does anyone have any ideas???
Won't that do? If you don't want to refer to it using the additional first
subscript every time, just create a reference to it:
$b = &$a[0];
then $b[$x] is the same as $a[0][$x].
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211