Hi,
I have page that allows the user to search using a "date range" AND "location".
I'm able to do this individually.
Its like, if the user searches using the date range (from begin date to end date) the results show.
Then if the user searches using a specific location (lets say USA) the results show.
but when the user searches using the date range AND the location, i get an error.
this is my code for the date range.
and this is for the location
and this is for the combined range and location. (which generates an error)
what do you think i should do?
Last edited by charvie on 28th May 2010, 7:02 am; edited 1 time in total
............................................................................................
THIS SIGNATURE IS BY::: AGENT COSMIC ----------QUOTE BY:::TECHY
I have page that allows the user to search using a "date range" AND "location".
I'm able to do this individually.
Its like, if the user searches using the date range (from begin date to end date) the results show.
Then if the user searches using a specific location (lets say USA) the results show.
but when the user searches using the date range AND the location, i get an error.
this is my code for the date range.
Code:
$data = mysql_query("SELECT * FROM table WHERE date BETWEEN '$beginDate' AND '$endDate' ");
and this is for the location
Code:
$data = mysql_query("SELECT * FROM table WHERE location = '$loc' ");
and this is for the combined range and location. (which generates an error)
Code:
$data = mysql_query("SELECT * FROM table WHERE date BETWEEN '$beginDate' AND '$endDate' AND location = '$loc' ");
what do you think i should do?
Last edited by charvie on 28th May 2010, 7:02 am; edited 1 time in total
THIS SIGNATURE IS BY::: AGENT COSMIC ----------QUOTE BY:::TECHY