Hi
Can anyone explain how to use a wildcard in a query when I am retrieving numbers / values.
I have a select that has options: All, 1 2 3 4
If user chooses All I want my query to bring back records where 1,2,3,4 are included else bring back just the number chosen
I have tried % and it doesnt work.
Here is my section of code: I need the 0 in the first section to be % effectively.
Any help appreciated
$colname_rs_grd = 0;
if (isset($_POST['id_grade'])) {
if ($_POST['id_grade'] == "All Grades") {
$colname_rs_grd = 0;
}else {
$colname_rs_grd = $_POST['id_grade'];
}
mysql_select_db($database_dashboard, $dashboard);
$query_rs_tbl1 = "SELECT t_gh_dash1.`WeekDay`, 'RaceCount' AS Category, Count(distinct t_gh_dash1.RaceID) as RaceCount FROM t_gh_dash1 WHERE t_gh_dash1.Pool Like '$colname_rs_pool' AND t_gh_dash1.GRD = '$colname_rs_grd' AND t_gh_dash1.trk Like '$colname_rs_trk' GROUP BY t_gh_dash1.`WeekDay`";
$rs_tbl1 = mysql_query($query_rs_tbl1, $dashboard) or die(mysql_error());
$row_rs_tbl1 = mysql_fetch_assoc($rs_tbl1);
$totalRows_rs_tbl1 = mysql_num_rows($rs_tbl1);