Jump to content

help with syntax error


webguync

Recommended Posts

I am getting an error w/ this code. Don't think my syntax is quite right. Was hoping for some assistance.

echo "<tr><th>Completion Time:</th></tr><tr><td>" . date('F j, Y g:i:sa'), (strtotime(['submit_timestamp']) -
strtotime($row['login_timestamp']))/60 . "</td></tr>";

Link to comment
Share on other sites

Here is your correct code:

 

echo "<tr><th>Completion Time:</th></tr><tr><td>" . date('F j, Y g:i:sa'), (strtotime($row['submit_timestamp']) -
strtotime($row['login_timestamp']))/60 , "</td></tr>";

 

Note, dot after 60 replaced to comma. Also added couple of brackets.

Link to comment
Share on other sites

ok thanks. No error now. The only problem I have now is the result is something like.

21235172.75

 

not sure what this is in? I want a result such as 60 minutes. The database info is.

login_timestamp=>2010-05-17 11:32:45,  	submit_timestamp=>2010-05-17 12:26:13

Link to comment
Share on other sites

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.