daniel28138 Posted January 19, 2014 Share Posted January 19, 2014 Can someone please tell me what I am doing wrong with this? I'm just getting "500 Internal Server Error" without an error number or explanation or anything. echo "<tr bgcolor=\"#333333\"><td><p><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\green\"><b>{$band['Name']} - Review Posted: {date("F j, Y g:i a", strtotime($band["timestamp"]))}</b></font></tr>"; It works without the date part. But if i put the date outside the html table, it gives the date... but I'm wanting it to display next to the "Name" like.... It would echo Band Name - Reviewed Posted: January, 18th 2014 at 2:30pm Or Band NameReviewed Posted: January, 18th 2014 at 2:30pm Many Thanks Quote Link to comment https://forums.phpfreaks.com/topic/285478-echo-date-problem/ Share on other sites More sharing options...
denno020 Posted January 19, 2014 Share Posted January 19, 2014 I'm curious, what do you use to code in? If you used any sort of IDE, then you would see that you have a syntax error. Using the curly braces around php functions in a string won't work, you need to concatenate the function inside the string. Refer to the fixed code below echo "<tr bgcolor=\"#333333\"><td><p><font face=\"Verdana, Arial, Helvetica, sans-serif\" color=\green\"><b>{$band['Name']} - Review Posted: ".date("F j, Y g:i a", strtotime($band["timestamp"]))."</b></font></tr>"; That should fix your problem. As for there not being an error number, 500 Internal Server Error is an error number.. Denno Quote Link to comment https://forums.phpfreaks.com/topic/285478-echo-date-problem/#findComment-1465695 Share on other sites More sharing options...
Solution daniel28138 Posted January 19, 2014 Author Solution Share Posted January 19, 2014 Wow!!! so all I needed to do was replace the } with ." I was close then I guess haha. Thank you very much. I'm still learning this as I go. Quote Link to comment https://forums.phpfreaks.com/topic/285478-echo-date-problem/#findComment-1465696 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.