0
How are you doing? am here with a question I am creating a website in HTML and PHP and wanted to show some data from mysql database, I have a field that is autoincrement that is datetime and with this field wanted to show the date itself and then also show the day of the week type (MONDAY, TUESDAY...) only that I’ve done 1001 searches and I’m doing exactly as they say and it doesn’t work for me... I wonder if you could lend a hand?
code:
$sql = "SELECT DATENAME(weekday, data), temperature, humidity FROM sensor WHERE `data` < (NOW() - INTERVAL 7 DAY) ORDER BY data DESC LIMIT 1";
Are you sure the function is
DATENAME
? Would not beDAYNAME(data)
? https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html– anonimo
Thanks for the help friend! Actually it was just that... others said to add weekday but this perfect!
– f1lipinos