ID: 32736 Updated by: [EMAIL PROTECTED] Reported By: bart at mediawave dot nl -Status: Open +Status: Bogus Bug Type: SQLite related Operating System: WinXP PHP Version: 5.0.4 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Sorry, but this is how SQLite works. Previous Comments: ------------------------------------------------------------------------ [2005-04-17 12:23:04] bart at mediawave dot nl Description: ------------ With the SQLite functions: The problem occurs when selecting fields in a tablename.fieldname manner. Example: SELECT test.myfield, test.otherfield FROM test The result array will have ['tablename.fieldname'] as index. This should be just ['fieldname'] as index. Reproduce code: --------------- <?php $dbfile = 'db/test2db.db'; if (!file_exists($dbfile)) { $setup = " CREATE TABLE test (myfield varchar(50), otherfield varchar(50)); INSERT INTO test (myfield, otherfield) VALUES ('value1', 'value1'); INSERT INTO test (myfield, otherfield) VALUES ('value2', 'value2'); "; } $connectionId = sqlite_open($dbfile, 0666, $sqliteerror); if ($setup) sqlite_exec($connectionId, $setup); $sql = 'SELECT test.myfield, test.otherfield FROM test'; $resultId = sqlite_query($connectionId, $sql); while ($result = sqlite_fetch_array($resultId, SQLITE_ASSOC)) print_r($result); ?> Expected result: ---------------- Array ( [myfield] => value1 [otherfield] => value1 ) Array ( [myfield] => value2 [otherfield] => value2 ) Actual result: -------------- Array ( [test.myfield] => value1 [test.otherfield] => value1 ) Array ( [test.myfield] => value2 [test.otherfield] => value2 ) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32736&edit=1