插入数据库php [英] insert into database php
本文介绍了插入数据库php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用php编写程序,我在数据库中插入日期遇到问题这是代码:
i am writing program using php and i faced problem in inserting the date in the database this is the code :
$e_no= $query_row['e_no'];
$grade= $query_row['e_grade'];
$ccn_code=$query_row['e_ccn'];
echo "<br>"."<br>".""."<FONT COLOR='FFFFF0'>"."Employee Name:".$query_row['e_name']."</font>"."";
echo ""."<FONT COLOR='FFFFF0'>"."Employee Number:".$query_row['e_no']."</font>"."";
echo ""."<FONT COLOR='FFFFF0'>"."Employee Design:".$query_row['e_design']."</font>"."";
if(isset($_REQUEST['submit']))
{ $otn_days=$_POST['date'];//take the date from date input
$otn_hrs=$_POST['text'];
$result2 = mysqli_query($connection,"INSERT INTO otn (e_no,grade,ccn_code,otn_days,otn_hrs) values($e_no,$grade,$ccn_code,$otn_days,$otn_hrs) ");
}}
else
{die($failconnection);}
之后,我检查数据库,日期列包含此值0000-00-00。
i分别检查代码并给我正确的日期,如2013-10-01
i不知道问题在哪里
after that i check the database , the date column contain this value 0000-00-00.
i check that code separately and give me correct date like 2013-10-01
i do not know where is the problem
推荐答案
e_no =
query_row [' e_no'];
query_row['e_no'];
grade =
这篇关于插入数据库php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文