Hi all:

I'm using mysql-3.22.32:

My PHP-embedded query is as follows:

else if($sortBy == '01') {
        $sql = "SELECT * FROM $table_cal WHERE item_activity='$id' AND 
DATE_FORMAT('item_date','%m') LIKE '$sortBy'"; 
        $sortBy = "Month of January";

* '$sortBy' is equal to '01'.
* MySQL isn't complaining about any of the query.
* DATE_FORMAT('item_date','%m') should be '01' (taken from 
a 'date' column in YYYY-MM-DD fromat.

Can anyone tell me what is wrong with this query (I may have missed 
something - but then that shouldn't surprise as I've been staring at it 
for 3 hours...;-)


         "Believe nothing - consider everything"        
           "Web Developers do it on-the-fly."
  Russ Michell
  Anglia Polytechnic University Webteam
  w: www.apu.ac.uk/webteam
  t: +44 (0)1223 363271 x 2331


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to