Whenever I query a SQLite database using an order by clause the returned array seems to combine the database columns. The first column contains the contents of each column, the second column contains the contents of each column except the first, the third column contain the contents of each column except the first and second, and so on.
Example database:
Code: Select all
Model Make Country
Cayman Porsche Germany
Elise Lotus EnglandCode: Select all
$db = new SQLiteDatabase("example.sdb");
$result_array = $db->arrayQuery("SELECT * FROM cars ORDER BY model LIMIT 1",SQLITE_ASSOC);
print_r($result_array); Array ( [0] => Array ( [model] => CaymanPorscheGermany [make] => PorscheGermany [country] => Germany ) )
If I leave out the order by clause it works fine:
Array ( [0] => Array ( [model] => Cayman [make] => Porsche [country] => Germany ) )
What am I missing here?
Thanks in advance.