php连接数据库,以及日期处理函数
php连接数据库,以及日期处理函数
$conn=mysql_connect("10.0.10.0:0000","root","123456") or die("数据库连接失败").mysql_error();
mysql_select_db("database");
$querry1 = "select * from `crm_module_27` where field1='" . $order_id . "'";
$cursor1 = mysql_query($querry1);
if ($row = mysql_fetch_array($cursor1)) {
$startwork=$row['field3'];
}
$now=date("y-m-d");
$nowy=date("y");
$nowy1=date("y",strtotime("-1 year"));
$nowy2=date("y",strtotime("+1 year"));
$nowm=date("m");
$nowm1=date("m",strtotime("-1 month"));
$nowm2=date("m",strtotime("+1 month"));
$nowd=date("d");
$startworky=date("y",strtotime($startwork));
$startworkm=date("m",strtotime($startwork));
$startworkd=date("d",strtotime($startwork));
上一篇: 前端开发HTML5——表单标签
下一篇: JAVA I/O(一)