0

I am getting this error:

Warning: oci_parse(): ORA-01756: quoted string not properly terminated in <DIRECTORY> on line 200 Warning: oci_execute() expects parameter 1 to be resource, boolean given in <DIRECTORY> on line 201

In reference to this code (line 200/201 marked):

        $testSQL =  "insert into INTOXDM.JOINT_USE (RECEIVED, 
                REGION, 
                PERMIT, 
                CUSTOMER, 
                TO_BUSINESS, 
                TO_PERMIT, 
                POWER_ADDRESS, 
                COMPANY, 
                MAPSECTION, 
                POLES, 
                FEE, 
                INVOICE, 
                DATE_LARRY, 
                DAYS_LARRY, 
                PI_PON, 
                DATE_PD, 
                DAYS_LARRY_PD, 
                RETURNED, 
                DAYS_PD, 
                ERRORS_PD, 
                ERRORS_MULTIPLE, 
                DATE_MAKEREADY_JU, 
                DATE_MAKEREADY_COMPLETE, 
                DAYS_MAKEREADY, 
                DAYS_JU_PROCES, 
                APPROVAL, 
                DAYS_PERMIT_IN_JU, 
                DATE_PLANNING, 
                DAYS_OPEN, 
                DATE_ROUTED, 
                DAYS_TOTAL, 
                COMMENTS) values (
                '$RECEIVED', 
                '$REGION', 
                '$PERMIT', 
                '$CUSTOMER', 
                '$TO_BUSINESS', 
                '$TO_PERMIT', 
                '$POWER_ADDRESS', 
                '$COMPANY', 
                '$MAPSECTION', 
                '$POLES', 
                '$FEES', 
                '$INVOICE', 
                '$DATE_LARRY', 
                '$DAYS_LARRY', 
                '$PI_PON', 
                '$DATE_PD', 
                '$DAYS_LARRY_PD', 
                '$RETURNED', 
                '$DAYS_PD', 
                '$ERRORS_PD', 
                '$ERRORS_MULTIPLE', 
                '$DATE_MAKEREADY_JU', 
                '$DATE_MAKEREADY_COMPLETE', 
                '$DAYS_MAKEREADY', 
                '$DAYS_JU_PROCESS', 
                '$APPROVAL', 
                '$DAYS_PERMIT_IN_JU', 
                '$DATE_PLANNING', 
                '$DAYS_OPEN', 
                '$DATE_ROUTED', 
                '$DAYS_TOTAL', 
                '$COMMENTS')";
        $testParse = oci_parse($objConnect, $testSQL); //LINE 200 
        $testExecute = oci_execute($testParse); } } //LINE 201

However, I cannot find what I am missing. I have been at it for an hour, it is very frustrating. Are there tools that you can post source into that assist in finding these errors?

Ryan_W4588
  • 648
  • 3
  • 13
  • 32
  • Please don't inject random raw input into your SQL code. Use `oci_parse()` and `oci_execute()` the way they're intended, with parameters. – Álvaro González Jul 11 '14 at 17:54
  • I'm confused why this was marked as duplicate, unless I am misunderstanding what the error means. Doesn't this mean that I missed a ' or " or ) etc in my code? I am, obviously, a novice programmer so I don't know too much. – Ryan_W4588 Jul 11 '14 at 17:58
  • Yes, you do have a syntax error in your SQL code, but that error happens because you compose your SQL code by concatenating variables with arbitrary contents—those variables become part of the code! That's called SQL Injection. Companies leak sensitive data now and then because of it. – Álvaro González Jul 11 '14 at 18:04
  • If you can only read one manual, I recommend [The Underground PHP and Oracle Manual](http://www.oracle.com/technetwork/topics/php/underground-php-oracle-manual-098250.html). – Álvaro González Jul 11 '14 at 18:05
  • 1
    Oh, alright I understand what you are saying. Thank you for teaching me the proper methods lol.. Odd how the other posts which have the exact same style of code weren't forewarned xD. All a learning process. – Ryan_W4588 Jul 11 '14 at 18:18

0 Answers0