Proper Syntax?
Posted: Fri Jun 21, 2002 7:23 am
Hi
I am tring to query a MySQL database. The user selects the year and date from a dropdown menu. My question is "What is the proper syntax to select all the months OR just one."
The dropdown menu lists:
ALL
JAN
FEB
MAR
etc....
If the user selects "ALL" I want the query to return all the rows matching the "date_month" column.
Thanks for the advice. Virgil
I am tring to query a MySQL database. The user selects the year and date from a dropdown menu. My question is "What is the proper syntax to select all the months OR just one."
The dropdown menu lists:
ALL
JAN
FEB
MAR
etc....
If the user selects "ALL" I want the query to return all the rows matching the "date_month" column.
Thanks for the advice. Virgil
Code: Select all
FROM eventpost WHERE date_year=$year_filter" AND date_month=month_filter;
$result = mysql_query($query);
check_mysql();
while ($row=mysql_fetch_array($result, MYSQL_ASSOC))