webguync Posted May 25, 2010 Share Posted May 25, 2010 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 https://forums.phpfreaks.com/topic/202852-help-with-syntax-error/ Share on other sites More sharing options...
-Karl- Posted May 25, 2010 Share Posted May 25, 2010 (strtotime(['submit_timestamp']) should be (strtotime($row['submit_timestamp']) I believe. Link to comment https://forums.phpfreaks.com/topic/202852-help-with-syntax-error/#findComment-1063075 Share on other sites More sharing options...
webguync Posted May 25, 2010 Author Share Posted May 25, 2010 still getting an error unfortunately. 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>"; Link to comment https://forums.phpfreaks.com/topic/202852-help-with-syntax-error/#findComment-1063079 Share on other sites More sharing options...
Sergey Popov Posted May 25, 2010 Share Posted May 25, 2010 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 https://forums.phpfreaks.com/topic/202852-help-with-syntax-error/#findComment-1063089 Share on other sites More sharing options...
webguync Posted May 25, 2010 Author Share Posted May 25, 2010 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 https://forums.phpfreaks.com/topic/202852-help-with-syntax-error/#findComment-1063100 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.