I am having serious problems although im sure the solution is relatively simple.
I am trying to insert lines into a db from a form, I keep getting this error>
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING' in /usr/local/httpd/htdocs/do_addrecord.php on line 13
Here is the code I am using >
//putenv("ORACLE_SID=dbone");
putenv("ORACLE_HOME=/u01/oracle/product/9ir2");
$connect=ocilogon("kc_labs", "helpme", "dbone.linux");
$sql = "INSERT INTO KC_CAMPUS.ELECTRONIC_PARTS (PART_NUMBER, PART_CATEGORY, PART_NAME, PART_DESCRIPTION, PART_KIT, PART_LOCATION, PART_COST, PART_PAR) VALUES ('$_POST["PART_NUMBER"]', '$_POST["PART_CATEGORY"]', '$_POST["PART_NAME"]', '$_POST["PART_DESCRIPTION"]', '$_POST["PART_KIT"]', '$_POST["PART_LOCATION"]', $_POST["PART_COST"], $_POST["PART_PAR"]);
$stmt = OCIParse($connect, $sql);
OCIExecute($stmt);
Im using the $_POST["variable"] becuae I am using php 4.3.2 and as I understand, that is how to do it.
Any help is appreciated.
NEED HELP INSERTING TO DB
Moderator: General Moderators
Thanks man.
I did a $PNUM = $_POST["PART_NUMBER"]; on the receiving page, to cut down on some of my confusion.
The single ticks fixed it right up and i can add records now
I knew it was something simple but this is my first time with php and im working on a linux box with oracle, they are trying to kill me i think....
I did a $PNUM = $_POST["PART_NUMBER"]; on the receiving page, to cut down on some of my confusion.
The single ticks fixed it right up and i can add records now
To understand more, this post might come in handy, when dealing with single and double quotes.
Just a sidenote.
Just a sidenote.