今日莫明其妙的网站首页出问题了,一些内容不显示,调整了半天发现:
$sql = "select * from tb_ads where classid = 4 order by sortid desc";
语句查询错误,但在mysql直接查询正确,数据库选择也正确,不明所以,逐步排查最终发现
$sql = "select * from tb_ads where classid = 4 order by sortid DESC";
查询便正常了。
总结:sql的语句关键字还是用大写比较靠谱
$sql_1 = "SELECT * FROM table_a WHERE account='abcdef' AND reg_time>'2013-01-01'";
$sql_2 = "SELECT * FROM table_a WHERE reg_time>'2013-01-01' AND account='abcdef'";
account是唯一的,这两句的查询,哪个会更快点?
html:
<table><form ...><tr><td><input ...>...</td></tr><form></table>
JQ:
alert($("form").find('input').length) //0
这样的html结构下找不到input元素,把table放在form里就行了