unixODBC PHP Update Anweisungsfehler
Ich verwende Ubuntu + php + unixodbc + mdbtools für die Arbeit mit MDB-Datei.
Alles (Verbindung + Auswahl) funktioniert gut, aber Insert- oder Update-Anweisungen.
Mein Code sieht ungefähr so aus:
$mdbConnection = new \PDO("odbc:mdbdriver",$user , $password , array('dbname' =>$FileName) );
$SelectResult = $mdbConnection->query("Select * from Zone");
$UpdateResult = $mdbConnection->query("Update Zone Set ShahrCode = 99");
$SelectResult
gibt ein korrektes Ergebnis zurück, aber das zweite wirft einen Fehler aus, der dazu führt, dass Apache einen Segfault-Fehler verursacht.
Ich teste es mit dem Befehl isql. Die Anweisung Running Select ist erfolgreich, das Update jedoch nicht.
#isql mdbdriver
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>Update Zone Set ShahrCode = 99
Error at Line : syntax error near Update
syntax error near Update
Got no result for 'Update Zone Set ShahrCode = 99' command
[08001][unixODBC]Couldn't parse SQL
[ISQL]ERROR: Could not SQLExecute
Oder
SQL> Update [Zone] Set ShahrCode = 99
Error at Line : syntax error near Update
syntax error near Update
Got no result for 'Update [Zone] Set ShahrCode = 99' command
[ISQL]ERROR: Could not SQLExecute
Wie soll ich diesen Fehler beheben? Vielen Dank an alle