[FONT=Verdana]To the willing members @ phpbuilder.com,
I'm trying to get a filtered list of all the genres in a certain table. Since a genre occurs several times in the table, I only want every genre once.
E.g. instead of Humour, Humour, Humour, Painfull, Painfull, 3D Animation
I want: Humour, Painfull, 3D Animation
The following script works (kinda), it gives me the list I want...
--------------------------------------
$db = new COM("ADODB.Connection");
$db->Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\some_database.mdb");
$rs = $db->execute("SELECT genre FROM some_table ORDER BY genre ASC");
$genre = $rs->Fields('genre');
while (!$rs->EOF) {
$myArray = array/COLOR;
if (!in_array($genre, $myArray)) {
array_push($myArray, $genre);
}
$rs->movenext;
foreach($myArray as $value) {
print "$value, ";
}
}
... but unfortunately it also throws me an error:
Fatal error: Uncaught exception 'com_exception' with message 'Source: ADODB.Field.
Description: Either BOF or EOF is True, or the current record has been deleted.
Requested operation requires a current record.' in :\the_above_php_script.php:52
So if anybody knows what I'm doing wrong or what I could do better, feel free to point me in the right direction ...
Sincerly,
interface[/FONT]