sql-吸取教训

Posted on 2006-10-13 17:30 my 阅读(302) 评论(0)  编辑  收藏 所属分类: 工作记录
今天在写一个查询程序
在SQL上暂时是这样写的:
$sql="select * from orders where createtime>='$begintime' and createtime<='$endtime' and state like'%$orderclass%' and firstname  like'%$firstname%' and lastname like'%$lastname%' and email like'%$emailname%' and realmlocation like'%$servername%' and servername like'%$realmname%' and faction like'%$faction%' and characters like'%$charact%' and ipnum like'%$ip%' and numbers>=$bnumbers and numbers<=$enumbers and moneys>=$bmoneys and moneys<=$emoneys";
值得注意的是
createtime>='$begintime' 中createtime是DATE型
numbers<=$enumbers 中numbers是整型
区别在加上了' ',被郁闷了一阵,虽人啊虽人

只有注册用户登录后才能发表评论。


网站导航:
 

posts - 63, comments - 45, trackbacks - 0, articles - 99

Copyright © my