Reputation:
I have a problem with the data output via echo. Using the following command, a display is off, so no date is displayed: echo '<b>Date:</b> ' . $output->date . ' <br><hr>';
What would be the correct syntax for outputting the date? I enter the date in the database using the following code (entries in the database are correct):
$StrSQL = "INSERT INTO contact (userid_fk,topic,message,date)
VALUES (?,?,?,NOW())";
Upvotes: 0
Views: 52
Reputation:
Found your problem! You're not selecting it from the db. You need to add date to the list of things you are selecting, or select *
Such as SELECT users.username as bn, contact.subject, contact.message, contact.date FROM users RIGHT JOIN contact ON users.userid = contact.userid_fk ORDER BY date DESC
Upvotes: 0
Reputation: 834
$StrSQL2 = "SELECT users.username as bn, contact.subject, contact.message, contact.date FROM users RIGHT JOIN contact ON users.userid = contact.userid_fk ORDER BY date DESC";
Upvotes: 1