ms access - unixODBC PHP Update statement error -
ms access - unixODBC PHP Update statement error -
i'm using ubuntu+php+unixodbc+mdbtools working .mdb file. every thing(connection+select) works good, insert or update statements. code :
$mdbconnection = new \pdo("odbc:mdbdriver",$user , $password , array('dbname' =>$filename) ); $selectresult = $mdbconnection->query("select * zone"); $updateresult = $mdbconnection->query("update zone set shahrcode = 99");
$selectresult
returns right result, sec 1 throws error cause apache segfault error. test isql command.running select statement successful update not.
#isql mdbdriver +---------------------------------------+ | connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ sql>update zone set shahrcode = 99 error @ line : syntax error near update syntax error near update got no result 'update zone set shahrcode = 99' command [08001][unixodbc]couldn't parse sql [isql]error: not sqlexecute
or
sql> update [zone] set shahrcode = 99 error @ line : syntax error near update syntax error near update got no result 'update [zone] set shahrcode = 99' command [isql]error: not sqlexecute
how should prepare error ? all
personally, wouldn't spend lot of time trying php + mdb_tools + unixodbc work reliably. have tried on several occasions , have been quite unsuccessful despite best efforts.
my recommendations be:
if maintaining info in access .mdb file firm requirement 1 must assume windows machines involved in project. in case suggest run php code on windows machine , utilize com_dotnet manipulate access database (via windows odbc using adodb.connection
, related objects).
if running php code on linux firm requirement there strong case moving info access .mdb other database works improve php. (mysql 1 of more mutual choices.)
if both 1. , 2. firm requirements perhaps best alternative might move .mdb file windows machine , utilize odbtp manipulate .mdb file php code running on linux machine.
php ms-access ubuntu unixodbc
Comments
Post a Comment