您好我是PHP的初學者,我嘗試使用日期列從表(billing_details)中檢索數據(單列之間的兩個日期之間即預訂)下面無法從日期列中檢索日期 - PHP Mysql
是源代碼
$from = mysql_real_escape_string($_POST['from']);
$to = mysql_real_escape_string($_POST['to']);
$from = date("d-m-Y", strtotime($from));
$to = date("d-m-Y", strtotime($to));
echo $from;
$sql = mysql_query("select * from billing_details where SRF ='$_POST[srf]' or Service_Type ='$_POST[service]' or Status ='$_POST[status]' or Branch ='$_POST[branch]' or DATE(`Booking`) between '".$from."' and '".$to."'");
![I have select two different dates to get datas between the selected dates , but nothing is retrieved, only the echo $from is retrieved the the selected date][1]
Kindly help me to solve this issue, Thanks in advance
Regards,
Abdul hameed
哇,太棒了,我已經改變了日期類型從$從=日期(「d-m-Y」,strtotime($從)); to $ from = date(「Y-m-d」,strtotime($ from));其工作完美,感謝橄欖威廉姆斯 – 2014-10-30 07:42:53
不客氣。一定要花時間閱讀php.net/date和/ strtotime來學習這些功能 – 2014-10-30 07:47:23
哦,如果這個答案是幫助你(或另一個)的答案,請點擊支票作爲接受的答案。謝謝 – 2014-10-30 07:49:21