99问答网
所有问题
php代码和MySqli 编写一个小程序
具体是 实现 一个人今天点的第一份餐 6元钱,在今天内再点餐就变成12元钱。
调用的数据库名字为diancan 里面的成员有 name number yuan date。
求大神 帮忙谢谢
举报该问题
推荐答案 2015-07-23
这个很简单,首先分析一下数据库是否有今天这个人的订单,
$sql= select count(*) from table where name=xx and date>$todaystart and date<$todayend;
$count=$db->get_row($sql);
if($count>0){
$yuan=12;
}else{
$yuan=6;
}
你需要一个取当天时间开始和结束的函数
温馨提示:答案为网友推荐,仅供参考
当前网址:
http://99.wendadaohang.com/zd/BBeeWjzzXeXttOzvjv.html
相似回答
大家正在搜