I am attempting to extract a date portion from a TIMESTAMP but not having much success. I initially tried selecting it in the query as a variable then extracting it, but Im assuming the syntax was incorrect for a string as it just said unexpected.
So im now trying to extract it using a selection query directly from the database using the following.
$date_added = mysqli_query($dbconnection,'SELECT DATE(date_added) FROM classifieds WHERE id = "'.$id.'"');
This query is being run inside a WHILE loop which has already selected the entire row and the rows identified $id. So ive set this to only look for the DATE from the current entry. When I run this however I get the following error:
Catchable Fatal Error - Object of Class mysqli_result could not be converted to a string in "website"
I'm obviously doing something wrong in the query but I cant see what.
Thanks