Jump to content

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


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)

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.