I suggest a simple form with an input text field for each criterion. Set the submit action to point to a search php file. This file retrieves the criteria from the get or post params and constructs a query string from them. e.g.
$sql_query .= "SELECT * FROM library";
// if any criteria are set add a where clause
if ($subject ¦¦ $title ¦¦ ...) {
£sql_query .= " WHERE";
// if a subject criteria was given add it to the where clause
if ($subject_criteria) {
$sql_query .= " subject = '$subject_criteria';
$multiple_criteria = 1; // show we have already got where clause
}
// if a title criteria was given add it to the where cause
if ($title_criteria) {
// if we already have where clause include AND for the new criteria
if ($multiple_criteria){
$sql_query .= " AND";
}
$sql_query .= " subject = '$subject_criteria';
$multiple_criteria = 1;
} . . .
$result = mysql_query($sql_query);
. . .
For default searches merely 'order by' the relevant field. e.g.
SELECT * FROM library ORDER BY subject
Please check the syntax of the above. I am doing this on a laptop on a plane so can;t runn it to check but it should be fairly obvious what's going on.
Hope this helps,
Cris