select * from members where fname = "*" and sname = "Smith"
I need to put a wildcard in the query because I am building it from code. Will the "*" work? Is that the correct method for wildcard within a test result?
Nope, * won't work as a wildcard. Using * to mean "where it's equal to anything" is just the same as leaving out of the query.
So select * from members where fname = "*" and sname = "Smith" becomes select * from members where sname = "Smith"
% is mysql's wildcard, so you can do things like, select * from members where fname='J%' and it will find all rows where fname begins with the letter J, but using an empty wildcard statement is just the same as leaving out of the query.