Query problem cont'd..

From: Date: Thu, 01 Jan 1970 00:00:00 +0000
Subject: Query problem cont'd..
Groups: php.db 
Request: Send a blank email to php-db+get-8914@lists.php.net to get a copy of this message
Hi there: I'm stil having problems with this query in that it doesn't bring up any results! Here is the <select> menu that refreshes the page and deposites the var: 'sortedBy' into play: <form> <select name=\"sortMonth\" onChange=\"MM_jumpMenu('parent',this,0)\";> <option>--select one--</option> <option value=\"$PHP_SELF?sortedBy=Jan\">Jan</option> <option value=\"$PHP_SELF?sortedBy=Feb\">Feb</option> <option value=\"$PHP_SELF?sortedBy=Mar\">Mar</option> <option value=\"$PHP_SELF?sortedBy=Apr\">Apr</option> <option value=\"$PHP_SELF?sortedBy=May\">May</option> <option value=\"$PHP_SELF?sortedBy=Jun\">Jun</option> <option value=\"$PHP_SELF?sortedBy=Jul\">Jul</option> <option value=\"$PHP_SELF?sortedBy=Aug\">Aug</option> <option value=\"$PHP_SELF?sortedBy=Sep\">Sep</option> <option value=\"$PHP_SELF?sortedBy=Oct\">Oct</option> <option value=\"$PHP_SELF?sortedBy=Nov\">Nov</option> <option value=\"$PHP_SELF?sortedBy=Dec\">Dec</option> </select> </form> The SQL qery: if( ($sortedBy == 'Jan') || ($sortedBy == 'Feb') || ($sortedBy == 'Mar') || ($sortedBy == 'Apr') || ($sortedBy == 'May') || ($sortedBy == 'Jun') || ($sortedBy == 'Jul') || ($sortedBy == 'Aug') || ($sortedBy == 'Sep') || ($sortedBy == 'Oct') || ($sortedBy == 'Nov') || ($sortedBy == 'Dec') ) { $sql = "SELECT * FROM $table_cal WHERE item_activity='$id' AND DATE_FORMAT('item_date','%b')='$sortedBy'"; } Thanks to Rasmus for helping me out so far! Can anyone see what I may be doing wrong??? I'm using mysql-3.22.32 and the item_date column is a MySQL DATE() column.. Cheers: Russ #-------------------------------------------------------# "Believe nothing - consider everything" "Web Developers do it on-the-fly." Russ Michell Anglia Polytechnic University Webteam e: r.j.michell@apu.ac.uk w: www.apu.ac.uk/webteam t: +44 (0)1223 363271 x 2331 www.theruss.com #-------------------------------------------------------#

« previous php.db (#8914) next »