开发者

How to fetch a record monthly wise

Drop down for month and year and then submit.

<span class="pln">fieldid</span><span class="pun">,</span>
<span class="pln"> name</span>
<span class="pun">,</span>
<span class="pln">&nbsp; &nbsp; &nbsp;time(int)<br></span>
<span class="pun">============================</span><span class="pln"><br></span>
<span class="lit">1</span>
<span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp;test1 &nbsp; &nbsp; </span>
<span class="lit">158565545</span><span class="pln"><br></span><span class="lit">2</span>
<span class="pln"> &nbsp; &nbsp; &nbsp; 开发者_C百科&nbsp;test2 &nbsp; &nbsp; </span>
<span class="lit">159545222</span><span class="pln"><br></span><span class="lit">3</span>
<span class="pln"> &nbsp; &nbsp; &nbsp; &nbsp;test3 &nbsp; &nbsp; </span>
<span class="lit">159995545</span><span class="pln"><br></span>

fieldid,  name,    time(INT)
============================
1        test1     158565545
2        test2     152548856
3        test3     159544856

etc....

Show report like: test1 is for current month test2 is for prev. month , etc.

How can I fetch records monthly-wise when I load a page the first time the current month report shows?


select *
  from MyTable
 where MONTH(FROM_UNIXTIME(time)) = MONTH(NOW())
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜