right now I have this pulling data for the current week, but the week starts on sunday, I would like the day to start on Monday how can I do this?
$result = mysql_query("SELECT * FROM form_2 WHERE week(timestamp) = week(NOW())");
Week 43. Week 43 is from Monday, October 24, 2022 until (and including) Sunday, October 30, 2022.
What week of the year is it? It is currently week 42 in 2022.
Monday or Sunday First? There are at least six different week numbering systems currently in use around the world. The most common is the International Standard ISO 8601, where Monday is the first day of the week followed by Tuesday, Wednesday, Thursday, Friday, Saturday, and with Sunday as the seventh and final day.
According to the international standard ISO 8601, Monday is considered the first day of the week.
According to the docs, use WEEK(timestamp,1)
You could try: "SELECT * FROM form_2 WHERE week(timestamp - INTERVAL 1 DAY) = week(NOW() - INTERVAL 1 DAY)"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With