Jump to content

ihatesyntax

New Members
  • Posts

    1
  • Joined

  • Last visited

ihatesyntax's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Can someone please help me with the required syntax for the following query in MySQL $monthQuery = "SELECT * FROM calendar WHERE mywhen >= CURDATE() AND YEAR(mywhen) = date('Y', strtotime($mywhen)) GROUP BY MONTH(mywhen) ORDER BY mywhen"; It's clearly to do with the date variable got YEAR(mywhen) but I can't get the combination right for a double-quoted statement, although it will work with single-quotes: $monthQuery = 'SELECT * FROM calendar WHERE mywhen >= CURDATE() AND YEAR(mywhen) = "' . date("Y", strtotime($mywhen)) . '" GROUP BY MONTH(mywhen) ORDER BY mywhen'; It just seems dreadfully ugly... Help?
×
×
  • 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.