Re: Extracting data from Arrays in ISAM table
| From: | itoctopus | Date: | Sun, 20 May 2007 09:53:08 +0000 |
| Subject: | Re: Extracting data from Arrays in ISAM table | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-43623@lists.php.net to get a copy of this message | ||
Step #1: Select name_field FROM the_table;
Step #2:
$arr_all_names = array();
foreach single_result in your result_set{ //you have to translate this into
php
$arr_name = explode(',', $single_result['name']); //assuming that you
are joining names in the field using a comma
$arr_all_names = $arr_all_names + $arr_name;
}
//remove redundancy
$arr_all_names = array_unique($arr_all_names);
//now sort the array
sort($arr_all_names);
//now all you have to do is to loop through the array to display it on your
site
--
itoctopus - http://www.itoctopus.com
<boclair@boclair.com> wrote in message news:464F7825.6090200@boclair.com...
>I have a table with between 100k and 200k rows. One field,
names, is
> populated, in each row, with an imploded array of up to 4 names.
>
> I require to create a list of names, without repeats, of all the names
> in names field to use in an html form.
>
> Any advise would be appreciated. I have no ideas on how to start.
>
> Louise
>
>
>
>