now i'm sure you see that the string literal assigned to the string field is enclosed in single quotes, and there are none for numericfield. Dates or date times can be a little tricky depending on the myriad of different ways that those values can be stored in the database. Sometimes they need quotes, other times they don't. Rather than going through all of the different date/time formats and how to represent them, it's easiest to just do a test case after selecting a valid value from exiting data, and making sure that you format dates accordingly.SELECT
stringfield = 'value'
AND numericfield > 0
Ok so the variables if you were passing variables into the query above would replace the values that the fields are being compared against. since the values themselves are basically being echo'd directly into place, a string value would have no single quotes, and the mysql interpreter would think that you're referencing a nonexistent field instead of a literal string.