Reputation: 4014
Let's say I have query structured like below which indicates dates
search.asp?date=091210
I want to find each record that includes 0912
string how can I inquire it on the link structure.
Upvotes: 0
Views: 215
Reputation: 2788
Indeed, never trust anything that is given on a URL. What you should do, is parse the date variable and split it up in a month, day and year part. Be sure to do the necessary sanity checks. Then you can issue a query like: SELECT * FROM yourTable WHERE MONTH(dateColumn) = month AND YEAR(dateColumn) = year
Upvotes: 1