Jump to content

[SOLVED] QUERY SELECTION


corillo181

Recommended Posts

hi!

i have a section where ppl can vote for stuff.

i want to know how can i make a query selection that select between the votes that happen Monday threw Sunday of the week before.

 

like if today is Monday - threw Sunday i want the votes that happen Monday threw Sunday of last week.

 

can this be done? any help will be appreciated i know if i can get a theory or even a starting point i can make the code.

 

thanks for any help.

Link to comment
https://forums.phpfreaks.com/topic/120553-solved-query-selection/
Share on other sites

no worries i got it, just needed to know a couple of functions in mysql.

 

jus tin case any one seach for the same question the answer is this

 

SELECT *
FROM `song_clicks`
WHERE YEARWEEK( `date` , 1 ) = YEARWEEK( DATE_SUB( CURRENT_DATE, INTERVAL 1 WEEK ) , 1 )
ORDER BY `date` DESC ;

 

seach for YEARWEEK and DATE_SUB,DATE_ADD

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.