Home » Open Source » Programming Interfaces » PHP Tablename Issue
PHP Tablename Issue [message #218566] Thu, 08 February 2007 13:06 Go to next message
gvandekrol
Messages: 8
Registered: February 2007
Junior Member
Good Afternoon,

I'm trying to select records from a table using PHP with Oracle.
I had no problems until I tried to select records from the table 'ORDER'
since there is a SQL command called ORDER it conflicts with the tablename.

$s = OCIParse($c, "SELECT * FROM ORDER");
OCIExecute($s, OCI_DEFAULT);

It gives me the errors: invalid table name
When I select records from another table called ORDER_ITEM it works fine.
Changing the table name is not an option.

And when I put single quotes around the table name it still fails.

Any help would be very much appreciated.

[Updated on: Thu, 08 February 2007 13:09]

Report message to a moderator

Re: PHP Tablename Issue [message #218567 is a reply to message #218566] Thu, 08 February 2007 13:09 Go to previous messageGo to next message
BlackSwan
Messages: 22793
Registered: January 2009
Senior Member
It will work using double quote marks, but it is a really, really bad idea to use Oracle Keywords as object names.
Re: PHP Tablename Issue [message #218570 is a reply to message #218567] Thu, 08 February 2007 13:16 Go to previous message
gvandekrol
Messages: 8
Registered: February 2007
Junior Member
Yeah I know its a bad idea, but I didn't create that table.

It worked!
Thanks a lot for your help
Previous Topic: PHP and Oracle
Next Topic: php-oracle oci8 issue
Goto Forum:
  


Current Time: Sun Sep 21 21:39:35 CDT 2014

Total time taken to generate the page: 0.07245 seconds