mysql querry of timediif to calculate difference in 3rd col
$2-8 USD / hour
In Progress
Posted over 12 years ago
$2-8 USD / hour
In mysql I have two column of time tcal and Tpost I just need there difference in third column Rtime. I tried various queries but nothing work.
I am very confused. I used these commands but nothing is woking.
First Try
$tresult = mysql_query("SELECT TIMEDIFF(tcal,Tpost) FROM $usertable");
mysql_query("UPDATE $usertable SET Rtime = $tresult");
[/code]
Second Try
mysql_query("UPDATE $usertable SET Rtime = TIMEDIFF(tcal,Tpost");
Only find that this code is working:
mysql_query("SELECT TIMEDIFF(tcal,Tpost) FROM $usertable");
But this code can only use with echo but i need to put the result back into my database
I need to use this time difference result in third coloumn..
If you have any other idea to calculate difference then discuss with me. I can share my team viewer id..
I am just stuck in this function its very simple usually takes 10-20 min to complete that's why my budget is very low..
Sri Technocrat is marvelous in its quality. We have been maintaining the quality in every field whether it is services or training. We have proved our stability. We have been working with the same grace & quality. Our Clients find us better than the so called best. We believe that Customer Satisfaction and Trust will always be our Key for success. Sri Technocrat provides the best breed of designing and application solutions to small and medium sized businesses around the world. A strong Dedicated Executive Team consists of leaders from Indian Institute of Technology (IIT) and various industries and backgrounds aimed at helping execute the plan.
With Regards Sri Technocrat.
hello,
i am good at mysql and php.
i have developed five projects at college level.
i can assure you about the performance and quality of project.i am a software engineer..