Home > Backend Development > PHP Tutorial > mysql - 求助!!php计算题。计算日期换算的

mysql - 求助!!php计算题。计算日期换算的

WBOY
Release: 2016-06-06 20:50:11
Original
1011 people have browsed it

先来一题:

$startdate = 2013-5-15 20:05:31

$enddate = 2013-5-16 20:05:31

$price = 11

$pricefive = 5

怎么计算一共花了多少个小时,

每个小时价格是11元,

并且每逢0:00 - 6:00 自动增加5元一小时,

求助啊!!谢谢!

还有一题,希望能帮到我。

表1:orders

有字段:userid,username

表2:users

有字段:userid2,username2

但我提交表格时候让用户只填写userid,

如何让它获取到另一个表users的usersname2并且保存到orders里的username

sql语句怎么写。。。?

回复内容:

先来一题:

$startdate = 2013-5-15 20:05:31

$enddate = 2013-5-16 20:05:31

$price = 11

$pricefive = 5

怎么计算一共花了多少个小时,

每个小时价格是11元,

并且每逢0:00 - 6:00 自动增加5元一小时,

求助啊!!谢谢!

还有一题,希望能帮到我。

表1:orders

有字段:userid,username

表2:users

有字段:userid2,username2

但我提交表格时候让用户只填写userid,

如何让它获取到另一个表users的usersname2并且保存到orders里的username

sql语句怎么写。。。?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template