Schmoopy
02-19-2009, 12:08 PM
Ok, so I've come up with a way I could possibly do my search bar which would involve selecting all records from the database each time, and then going through those records with preg_match to find a regular pattern and find the record that way.
Of course, that would be very inefficient, so I was hoping there was some way in MySQL you can do: "SELECT * FROM column WHERE column5 = '$search'" At the moment, this would only returnexact matches, which is what I don't want. I want there to be a little flexibility so that if there's a record with the value "Address 50" I want the user to just be able to search 50 and it come up, not have to type the exact value every time. How could I go about doing this? Would it be very complicated?
Of course, that would be very inefficient, so I was hoping there was some way in MySQL you can do: "SELECT * FROM column WHERE column5 = '$search'" At the moment, this would only returnexact matches, which is what I don't want. I want there to be a little flexibility so that if there's a record with the value "Address 50" I want the user to just be able to search 50 and it come up, not have to type the exact value every time. How could I go about doing this? Would it be very complicated?