MySQL PHP Search

Associate
Joined
25 Oct 2007
Posts
114
Location
Belfast
Hey, I have data stored in a MySQL Database and im looking to let a user be able to search the database. Using a text input and submit form.

I am a beginner to PHP so if anyone knows any tutorials or anything that would be great.
 
select * from tblPeople where firstName like '%mccrum%'

Would search the tblPeople for the firstName column for rows containing 'mccrum'
 
select * from tblPeople where firstName like '%mccrum%'

Would search the tblPeople for the firstName column for rows containing 'mccrum'

This.

I believe it also looks for names "like" mccrum so occrum should show up too, right? I forget what the percentage signs are for though.
 
I can display the data fine, want to be able to search the data :-)

Just to clarify, are you saying you want to pull the un filtered recordset back from the database and then search using PHP rather than searching on the database and bringing back only matching results ?

RB
 
Back
Top Bottom