Results 1 to 15 of 15
Thread: Wildcard in MYSQL
Jul 17, 2012, 08:36 #1
Wildcard in MYSQL
I am trying to design a database call to operate from a filter control so that I can select things out of the DB depending on which options are selected on the UI. However I need to first check that the syntax I have in mind will work with MYSQL as I don't use many statements of this type.
For example I know you can use the SELECT * from DB method but what if I were to pass it a php variable "*" would that then allow me to go:
SELECT * from DB WHERE manufacturer="samsung" and price = $var // var is a string "*"
which would then filter a specific manufacturer but disregard whether the user had selected a particular price range so my meaning is get any price
or vice versa could I go
SELECT * from DB WHERE manufacturer=$var and price >= "50" /. to get all manufacturers but a particular price?
I know the punctuation is a little off but its only an illustration, I would be very grateful if someone could help me
Silversurfer"Persistence is the path to perfection"