sql - Inserting Timestamp value into database(Oracle) using php -
i have simple table follow :
create table worker ( office_start_time timestamp, office_end_time timestamp );
i have html form follow :
<form method="post" action=""> <input type="datetime-local" name="office_start"> <input type="datetime-local" name="office_end"> <input type="submit" name="submit" value="submit"> </form>
i want datetime value html form , insert table. have tried following code :
$c1 = oci_connect("system", "faisal4590", 'localhost/faisal'); $start_time = htmlspecialchars(date('m.d.y h:i:s', strtotime($_post['office_start']))); $end_time = htmlspecialchars(date('m.d.y h:i:s', strtotime($_post['office_end']))); $stmt = "insert worker (office_start_time,office_end_time) values(to_timestamp($start_time, 'yyyy-mm-dd hh:mm:ss'), to_timestamp($end_time, 'yyyy-mm-dd hh:mm:ss'))"; $stid = oci_parse($c1, $stmt); oci_execute($stid);
i don't understand why getting error don't have missing parenthesis in code. can please? thanks..
Comments
Post a Comment