Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Seach Form to MYSQL DB

Status
Not open for further replies.

fooobee

Technical User
Nov 13, 2003
33
US
I am new to PHP, and was wondering if anyone knows of a good article, resource that can show me how to efficiently develop a form that searches a mysql DB. I want to create an advanced search form for a job portal. Some of the controls will allow multiple selections ie Locations, Job Categories, so any code to show me how to correctly parse those in php would also be appreciated. Thanks...

 
I always recommend starting with the PHP online manual.


Getting data from a form field to a PHP variable:[ul][li]PHP populates superglobal arrays automatically: [/li][li]A PHP quirk dealing with <SELECT> tags that have the "multiple" option set: [/li][/ul]

Fetching data from MySQL
All operations take the same steps:[ol][li]connect to the database[/li][li]Select a database[/li][li]send a query to the database server[/li][li]optionally fetch returned data[/li][/ol]You can see all four steps demonstrated in the example code on the PHP online manual page for mysql_fetch_assoc():

The only thing tricky is combining user input into a MySQL query.



Want the best answers? Ask the best questions! TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top