$sql=\"select SUM(count) from all_online_info where time betwee\".\'date(\"Y/m/d\",strtotime(\"-1 day\")) i:00 and date(\"Y/m/d\",strtotime(\"-1 day\")) i:59;
<pre id=\"best-answer-content\" class=\"reply-text mb10\">echo$sql=\'select SUM(count) from all_online_info where time betwee\'.date(\"Y/m/d\",strtotime(\"-1 day\")).\' \'.$i.
\':00 and \'.date(\"Y/m/d\",strtotime(\"-1 day\")).\' \'.$i .\':10br\';
<h4 class=\"ask\">追问
<pre class=\"replyask-text\" id=\"content-4727252\">不好意思,我运行看了下,结果是select SUM(count) from all_online_info where time betwee2011/04/17 1:00 and 2011/04/17 1:10,如果我要获得select SUM(count) from all_online_info where time betwee ‘2011/04/17 1:00’ and ‘2011/04/17 1:10’怎么改呢?就是日期当字符处理
<pre class=\"replyask-text\" id=\"content-4730184\">echo$sql=\'select SUM(count) from all_online_info where time betwee \"\'.date(\"Y/m/d\",strtotime(\"-1 day\")).\' \'.$i.
\':00\" and \"\'.date(\"Y/m/d\",strtotime(\"-1 day\")).\' \'.$i .\':10\"br\';
{
$r=\"select * from all_online_info where DAYOFYEAR(date(\"Y/m/d\")) -DAYOFYEAR(time)=0 andYEAR(date(\"Y\"))-YEAR(time)=0 and date(\"G\")-\".$i.\"=0 \";
mysql 运行查找