I am receiving a ORA-00917: missing comma warning at the line marked below, which infers that this is occurring in my query. However, I have gone over my query a lot of times and cannot seem to locate this "missing comma". Thank you for your time. "Warning: oci_execute() [function.oci-execute]: ORA-00917: missing comma in"
if(isset($_POST['submit']))
{
$db = oci_connect('user', 'password, "server/host");
$Notes = kFile($_POST["notes"]);
if(empty($_POST["composite"])){$composite = "No";}else{$composite = "Yes";}
$techName = $_POST['techName'];
$setupDate = $_POST['setupdate'];
$removalDate = $_POST['removaldate'];
$startDate = $_POST['startdate'];
$stopDate = $_POST['stopdate'];
$sampleLocation = $_POST['samplelocation'];
$serialN = $_POST['serialn'];
$filterN = $_POST['filtern'];
$initialFlow = $_POST['initialflow'];
$timerStop = $_POST['timerstop'];
$finalFlow = $_POST['finalflow'];
$timerStart = $_POST['timerstart'];
$finalWeight = $_POST['finalweight'];
$temperature = $_POST['temperature'];
$initialWeight = $_POST['initialweight'];
$atmPressure = $_POST['atmpressure'];
$filterLoad = $_POST['filterload'];
$query = "INSERT INTO DATA(
TECHNICIAN_NAME,
SAMPLE_LOCATION,
SERIAL_NUM,
FILTER_NUM,
START_DATE,
START_TIME,
STOP_DATE,
STOP_TIME,
INITIAL_FLOW,
FINAL_FLOW,
TIMER_STOP,
TIMER_START,
FINAL_WEIGHT,
INITIAL_WEIGHT,
TEMPERATURE,
ATM_PRESSURE,
COMMENTS,
NOT_IN_COMPOSITE,
FILTER_LOAD,
SET_UP_DATE,
REMOVAL_DATE)
VALUES(
:name, :sample, :serial, :filter, TO_DATE(:startDate, 'mm/dd/yyyy'), TO_DATE(:startTime, 'mm/dd/yyyy'),
TO_DATE(:stopDate, 'mm/dd/yyyy'), TO_DATE(:stopTime, 'mm/dd/yyyy'), :initialFlow, :finalFlow, :timerStop,
:timerStart, :finalWeight, :initialWeight, :temperature, :atmPressure,
:comments, :composite, :filterLoad, TO_DATE(:setup, 'mm/dd/yyyy'), TO_DATE(:removal, 'mm/dd/yyyy'))";
$compiled = oci_parse($db, $query);
oci_bind_by_name($compiled, ':name', $techName);
oci_bind_by_name($compiled, ':sample', $sampleLocation);
oci_bind_by_name($compiled, ':serial', $serialN);
oci_bind_by_name($compiled, ':filter', $filterN);
oci_bind_by_name($compiled, ':startDate', $startDate);
oci_bind_by_name($compiled, ':startTime', $startDate); //redundant check db
oci_bind_by_name($compiled, ':stopDate', $stopDate);
oci_bind_by_name($compiled, ':stopTime', $stopDate); //redundant check db
oci_bind_by_name($compiled, ':initialFlow', $initialFlow);
oci_bind_by_name($compiled, ':finalFlow', $finalFlow);
oci_bind_by_name($compiled, ':timerStop', $timerStop);
oci_bind_by_name($compiled, ':timerStart', $timerStart);
oci_bind_by_name($compiled, ':finalWeight', $finalWeight);
oci_bind_by_name($compiled, ':initialWeight', $initialWeight);
oci_bind_by_name($compiled, ':temperature', $temperature);
oci_bind_by_name($compiled, ':atmPressure', $atmPressure);
oci_bind_by_name($compiled, ':comments', $kosterNotes);
oci_bind_by_name($compiled, ':composite', $composite);
oci_bind_by_name($compiled, ':filterLoad', $filterLoad);
oci_bind_by_name($compiled, ':setup', $setupDate);
oci_bind_by_name($compiled, ':removal', $removalDate);
oci_execute($compiled); //warning occurs here
echo "Did I execute?";
}
Thanks for looking.
It looks like you're missing the last parenthesis in the query; the one that will enclose the VALUES
list:
$query = "INSERT INTO ... VALUES(..., TO_DATE(:removal, 'mm/dd/yyyy')";
need one more parenthesis here ^
Fixed:
$query = "INSERT INTO ... VALUES(..., TO_DATE(:removal, 'mm/dd/yyyy'))";
here it is ^
Look at the text highlighting in your question above. Then look at the third line of code where you set your password. Note that there is missing single quote. Any good code editor should make this problem readily apparent.