0

I'm having a really weird problem. I have a Linux server with PHP 7.0.22 and the PDO_OCI extension installed. This server is used in an API that receives SOAP requests and then queries an ORACLE database (11g - which, unfortunatelly, I don't have log access).

I've had a few services running here for a while, all select and update statements. All my queries use prepared statements, transactions and rollback. So far so good. The weird part is that I can't run INSERT statements from PHP. It gives me error ORA-00933: SQL command not properly ended. At first I thought I wasn't using prepared statements correctly, so I wrote the SQL manually and tried to run it from PHP and it gave me the same error. I tried debugging from a trillion different ways, but I can't seem to insert it from there. I even dumped the SQL generated, went to my SQL client and ran it, and it inserted the data correctly (to exclude sql syntax problems).

Can anybody shed any light here? My queries are very simple, like INSERT INTO table (field1, field2) VALUES (value1, value2);

1 Answers1

1

As answered by @Kudu2, there was a semicolon at the end of my statement, and somehow the PHP driver didn't like it. I removed it and it went through.

  • I can't believe it. Why shouldn't we end a statement with a semicolon? Seems weird and stupid. – migli Dec 22 '22 at 11:04