Oh, the following code is a little messy ah, is what I do in the test, PHP mysql date calculation code [DATEDIFF] is also I need today to try it. Look at the code here.
function A ($d) {
$Date _1=date ("y-m-d");
$Date _2= $d;
$Date _list_a1=explode ("-", $Date _1);
$Date _list_a2=explode ("-", $Date _2);
$d 1=mktime (0,0,0, $Date _list_a1[1], $Date _list_a1[2], $Date _list_a1[0]);
$d 2=mktime (0,0,0, $Date _list_a2[1], $Date _list_a2[2], $Date _list_a2[0]);
Return round ($d 1-$d 2)/3600/24);
}
Echo $Days;
$d =date ("y-m-d h:i:s");
$sql = "SELECT * from Wk_member where m_ip= ' 127.0.0.1 ' and DateDiff (m_dtime, ' $d ') =0";
$result =mysql_query ($sql) or Die (Mysql_error ());
if (mysql_num_rows ($result) <5) {
echo ' t ';
}
while ($rs =mysql_fetch_array ($result)) {
echo $rs [' id '];
Echo ' <br> ';
}
Original site reproduced please specify www.111cn.net