Jump to content

Problem using PL/SQL within PHP


jake_ms

Recommended Posts

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

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);

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.