I need a cut-and-paste code page(s) for a simple PHP & MySQL search page
Posted on 2009-05-15
I would like to learn to do this on my own, but I find that I learn much better if I can take the thing apart and then rebuild it.
I need a page that connects to my MySQL table and lets he user select to search by "catalog#, mfgr_name, or upc_code". Can be radio button or checkbox. Then just one input field to search, where the SELECT statement can use LIKE for the input param.
Then, when the results are displayed, I need them in a table. Make the table as ugly and plain as you like, I can format the HTML output later myself, but pagination would be great.
For extra points, I'd like to make the search by manufacturer actually query the DB and generate a dropdown list of all unique (DISTINCT) manufacturers. Selecting a given manufacturer would then return a table of all DB items where mfgr_name = the dropdown selection. (250 extra points for this)
I know this is a pretty standard scenario. I have 2 Oreilly books, but not being versed enough in PHP, I dont know what to pull out or leave in from their example code.