Jump to content

close but no cigar- subtracting the difference between two timestamp fields


webguync

Recommended Posts

Your two queries (on the same table by the way) have nothing in them to relate the results from the first query to the second query and in fact you are re-executing the second query every time you fetch a row from the first query's result set.

 

You need to execute ONE query that gets all the data you want and then simply loop though that data and display it.

I didn't expect this thread to still be going!

 

You should be able to just use the example code on page 1  just add the extra fields in the select

ie

SELECT Responses.name,Answer1,Answer2,Answer3,Answer4,Answer5,Answer6,Answer7,Answer8,Answer9,Answer10,Answer11,Answer12,
TIMESTAMPDIFF(SECOND,submit_timestamp,login_timestamp) as cTime
FROM Responses
LEFT JOIN Candidates
USING (user_id)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.