Results.php page

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Sonny1973
Forum Newbie
Posts: 1
Joined: Sat Apr 16, 2005 3:47 am

Results.php page

Post by Sonny1973 »

i'd like to know how you would structure the following query for multiple selectnames (which are all contained in the search form, via multiple drop down menus):

Code: Select all

$query = mysql_query("SELECT * FROM tablename WHERE selectname LIKE '%$search%' LIMIT 0, 50"
also, i'd like to get rid of the Search box in the search form. so in other words i don't want to reference a search value, '%$search%', at all. all of the possible options for each selectname will be contained in their respective drop-down menus.

also is it possible to generate a customized (by me, the webmaster) visitor search form for MySQL database, using phpAdmin? if not, what front-end user software would anyone recommend?

thanks for any help in advance.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

use a switch flow control construct to help generate the query string. Do not use the values from the drop downs passed in (they can be manipulated). This will require you requerying the database for the data that filled the drop downs likely if the data contained within can changed..

phpMyAdmin is not something a user should be playing with. Build your own, more user friendly system. Don't let them give you queries to run.. build the query yourself in the code. These are mostly security issues..
Post Reply