Ask a Question related to PHP Development, Design and Development.
-
Pete Morganic #1
Re: php mysql array question
I use the PEAR db http://pear.php.net/manual/en/package.database.php
This returns arrays - examples here
http://pear.php.net/manual/en/packag...ntro-fetch.php
look at the Quick data retreaval down the page
pete
Larry Brown wrote:> Is there any php function to pull a query into an array? I know there is a
> way to get the first row of the results in an array, but I'm having to loop
> through each row pushing the row onto an array to get the result I'm looking
> for and it seems like a lot of code for something that I would think is used
> a lot.
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
>Pete Morganic Guest
-
mySQL and Array
Hi all- I have defined an array using: <cfset notesattached = ArrayNew(1)> and added some data like this: <cfset notesattached = 4>... -
MySQL Table Question > Array?
I'm programming a Gaming Ladder/Tournament system. Let's say I have the following tables: PLAYERS ------- * Player_ID * Player_name .... *... -
array question (grep -v on array)
Hi, I have an output of errors fed into an array, after which I only look at things I care about and put them in a different array: ... -
HOW TO -- ARRAY UPDATE MYSQL
HI ALL, I want to update a mulitple row from a HTML Table to MYSQL Database. L1 V1 T1 L2 V2 V2 L3 V3 V3 Any help in this regard is much... -
[PHP] php mysql array question
> Is there any php function to pull a query into an array? I know there is a loop looking used There's no PHP function to do so. Some... -
Rob Adams #2
Re: php mysql array question
It shouldn't take a lot of code to put results into an array:
$query = "select * from table";
$r = mysql_result($query);
while ($row = mysql_fetch_object($r))
$hold[] = $row;
(OR, to index by some id field in the database:)
$hold[$row->id] = $row;
mysql_free_result($r);
Total of 5 lines.
-- Rob
"Larry Brown" <larry.brown@dimensionnetworks.com> wrote in message
news:CBECIONKKLMDDCIKHALJAECJIAAA.larry.brown@dime nsionnetworks.com...a> Is there any php function to pull a query into an array? I know there isloop> way to get the first row of the results in an array, but I'm having tolooking> through each row pushing the row onto an array to get the result I'mused> for and it seems like a lot of code for something that I would think is> a lot.
>
> Larry S. Brown
> Dimension Networks, Inc.
> (727) 723-8388
>
>
Rob Adams Guest



Reply With Quote

