jake_ms Posted April 18, 2007 Share Posted April 18, 2007 Hi all, I've got this bit of code I've cut out of my PHP file: $name = $_POST["name"]; $hiredate = $_POST["hiredate"]; $job = $_POST["job"]; $mgr = $_POST["mgr"]; $sal = $_POST["sal"]; $dept_name = $_POST["dept_name"]; $query = "Insert into Staff VALUES (Sequence1_SEQ.nextval, '" $name"' ," . $hiredate . ",'" . $job . "'," . $mgr . ", " . $sal . "," . $dept_name . ")"; $stmt = OCIParse($con, $query) or die ('Can not parse query'); OCIExecute($stmt) or die ('Can not Execute statement'); OCIFreeStatement($stmt); OCILogoff($con); echo "$no"; It's giving me the old "Parse error: parse error in /homedir/ilex-s01/jmsuther/public_html/AddStaffAction.php on line 23" Anybody know what's wrong or could point me in the right direction it's be much appreciated. Thanks very much Link to comment https://forums.phpfreaks.com/topic/47657-problem-using-plsql-within-php/ Share on other sites More sharing options...
Guest prozente Posted April 19, 2007 Share Posted April 19, 2007 You're missing the periods before and after $name Link to comment https://forums.phpfreaks.com/topic/47657-problem-using-plsql-within-php/#findComment-232757 Share on other sites More sharing options...
jake_ms Posted April 19, 2007 Author Share Posted April 19, 2007 Ok thanks, I've tried that, but I'm still getting a parse error! Any help please!!! $query = "Insert into Staff VALUES ("Sequence1_SEQ . "." . nextval ."'" . $name . "' ,'" . $hiredate . "','" . $job . "'," . $mgr . "," . $sal . "," . $dept_name . ")"; $stmt = OCIParse($conn, $query) or die ('Can not parse query'); OCIExecute($stmt.OCIDefault) or die ('Can not Execute statement'); // OCIFreeStatement($stmt); OCILogoff($con); Link to comment https://forums.phpfreaks.com/topic/47657-problem-using-plsql-within-php/#findComment-233011 Share on other sites More sharing options...
Guest prozente Posted April 19, 2007 Share Posted April 19, 2007 look at your double quotes right after Sequence1_SEQ. There won't always be someone to tell you what's wrong, you need to be able to recognize your mistakes. Look over your entire query, look at nextval also. Link to comment https://forums.phpfreaks.com/topic/47657-problem-using-plsql-within-php/#findComment-233013 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.