如何在php mysql中两次获得差异 [英] how to get difference between two time in php mysql
本文介绍了如何在php mysql中两次获得差异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是PHP新手。尝试使用数据库作为mysql在php中获得两次差异。
我尝试了这个,但它不起作用。
可以任何请帮助我吗?
Hi,
I am new to PHP. Trying to get difference of two time in php using database as mysql.
I tried with this, but its not working.
Can any one help me please ?
$qry = SELECT TIMEDIFF(saturday_out, saturday_in)FROM attendance1;
$res= mysql_query($qry);
mysql_query("UPDATE attendance1 SET total=$res WHERE UserName=$_SESSION[uid]);
推荐答案
qry = SELECT TIMEDIFF(saturday_out,saturday_in)FROM attendance1;
qry = SELECT TIMEDIFF(saturday_out, saturday_in)FROM attendance1;
res = mysql_query(
res= mysql_query(
qry);
mysql_query( UPDATE attendance1 SET total =
qry); mysql_query("UPDATE attendance1 SET total=
这篇关于如何在php mysql中两次获得差异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文