I need a php script that u might have !

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
taghiti
Forum Newbie
Posts: 1
Joined: Wed May 26, 2004 9:31 am

I need a php script that u might have !

Post by taghiti »

I need a php script of searching in a database by 6 criterias, if you got one or have an idea how to do it, please reply.

Thank you in advance.
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

Fairly simple to write your own, make your html form, get it to post to the php page, have this page construct the query that searches the database:

Code: Select all

$sql = "SELECT * FROM blah WHERE active = '1'"
if(isset($_GET['title'])){
   $sql .= " AND title = '".$_GET['title']."'";
}
if(isset($_GET['author'])){
   $sql .= " AND author = '".$_GET['author']."'";
}
etc.
Post Reply