Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #4643
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.42!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder2-2.proxad.net!nx01.iad01.newshosting.com!newshosting.com!69.16.185.11.MISMATCH!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!spln!extra.newsguy.com!newsp.newsguy.com!not-for-mail |
|---|---|
| From | John Drako <jbravo556@gmail.removethis.com> |
| Newsgroups | comp.lang.php |
| Subject | Fast/Easy way to extract a column from multi-dimensional array? |
| Date | Fri, 27 Jan 2012 15:08:01 -0500 |
| Organization | AAL - Anonymous At Large |
| Lines | 31 |
| Message-ID | <jfv06v01hoa@news6.newsguy.com> (permalink) |
| Reply-To | jbravo556@gmail.removethis.com |
| NNTP-Posting-Host | pc96b5318a885e32e07a9e24a120950459975dbf70c11ee93.newsdawg.com |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Transfer-Encoding | 7bit |
| User-Agent | Hogwasher/4.3 |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.php:4643 |
Show key headers only | View raw
I'm looking for a way to get all the values from the column of a two dimensional array. For example, I have a query on a mysql database that returns 10 rows from the database, I would like to quickly (read low cpu load) extract all the IDs from all the rows returned to reuse in another query. So let's say I use: $arr = mysqli_fetch_all($result, MYSQLI_ASSOC); and $arr looks like: RecordID, name, last name, title RecordID, name, last name, title RecordID, name, last name, title RecordID, name, last name, title RecordID, name, last name, title RecordID, name, last name, title etc... I need to get all the 'RecordID' from the results to reuse in other queries. Is there a built in PHP function (compiled code) to accomplish this? I've read the definitions of all the functions related to arrays and if it exists, I didn't find it. The site is very busy and CPU cycles count. I'm trying to avoid left joining three gigantic tables.
Back to comp.lang.php | Previous | Next — Next in thread | Find similar | Unroll thread
Fast/Easy way to extract a column from multi-dimensional array? John Drako <jbravo556@gmail.removethis.com> - 2012-01-27 15:08 -0500
Re: Fast/Easy way to extract a column from multi-dimensional array? "J.O. Aho" <user@example.net> - 2012-01-27 21:50 +0100
Re: Fast/Easy way to extract a column from multi-dimensional array? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-01-27 22:49 +0100
Re: Fast/Easy way to extract a column from multi-dimensional array? Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2012-01-27 21:52 +0100
Re: Fast/Easy way to extract a column from multi-dimensional array? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-27 22:42 +0100
Re: Fast/Easy way to extract a column from multi-dimensional array? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-27 22:55 +0100
Re: Fast/Easy way to extract a column from multi-dimensional array? Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2012-01-27 23:49 +0100
Re: Fast/Easy way to extract a column from multi-dimensional array? Jeff North <jnorthau@yahoo.com.au> - 2012-01-28 13:52 +1100
Re: Fast/Easy way to extract a column from multi-dimensional array? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-01-28 21:28 +0100
Re: Fast/Easy way to extract a column from multi-dimensional array? Arno Welzel <usenet@arnowelzel.de> - 2012-01-28 09:49 +0100
Re: Fast/Easy way to extract a column from multi-dimensional array? John Drako <jbravo556@gmail.removethis.com> - 2012-01-29 13:54 -0500
csiph-web