Jump to content


Help with date query!


  • Please log in to reply
4 replies to this topic

#1 Guest_DJ Phinesse_*

Guest_DJ Phinesse_*
  • Guests

Posted 30 June 2006 - 04:46 PM

Here is the query:

select tbl_voter.songid, tbl_artists.artistName, tbl_songs.songTitle, tbl_songs.songUrl, tbl_labels.labelName, tbl_voter.voteDate, count(*) AS Votes from tbl_voter, tbl_songs, tbl_artists, tbl_labels WHERE tbl_songs.artistID = tbl_artists.artistID AND tbl_songs.songID = tbl_voter.songID AND tbl_artists.labelID = tbl_labels.labelID AND tbl_voter.voteDate >= '2006-05-28' group by songid order by Votes DESC;

Any advice appreciated!

Charles

#2 jworisek

jworisek
  • Members
  • PipPipPip
  • Advanced Member
  • 112 posts

Posted 30 June 2006 - 06:18 PM

you know, it is quite helpful if you actually tell us some information.  You know, like what it should do and what it is doing wrong...  maybe tell us what error you are getting?

#3 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 03 July 2006 - 05:09 AM

Other than the fact that JOIN syntax would make that query actually legible, it looks syntactically correct -- which means it's just not doing what you want it to do.. Please clarify.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

#4 djphinesse

djphinesse
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 05 July 2006 - 05:31 AM

Sorry for being so stoopid, guys!

Background info: I want a script that will pull out 10 songs with the most votes from dB. I want the voteDate to be a variable in the query so I can change it with PHP. I was just testing it with a date to see if it would work.

#5 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 05 July 2006 - 09:59 PM

Still... what's it currently retrieving?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users