"; > > } > > $nav_block .= "

Search > Again"; > > if ($total_found != 0) { > > include("DVDLOOKUP_results.html"); > > } else { > > include("DVDLOOKUP_no_rslt.html"); > } > > ?> > > All I want to do is search on multiple criteria (all Sci-fi > dvds that have the word space in the title for example, or > all dramas with a particular actor in them made before 1990). > > I never get the results I want, and I think it is because of > the way I'm passing the Category pop-up menu and the Format > radio button. > > Any suggestions? > Thanks! > John ">??
?

Search Help Board

PHP FAQ
PHP Articles
PHP Help
Bulletin Board

PHP Manual (NEW!)
First Time PHP'ers
Help with programming
Sql assignment help
PHP Homework Help


C# Help

?
?Trying to get radio buttons and pop-up menus to work
";

}

$nav_block .= "

Search Again";

if ($total_found != 0) {

include("DVDLOOKUP_results.html");

} else {

include("DVDLOOKUP_no_rslt.html");
}

?>

All I want to do is search on multiple criteria (all Sci-fi dvds that have the word space in the title for example, or all dramas with a particular actor in them made before 1990).

I never get the results I want, and I think it is because of the way I'm passing the Category pop-up menu and the Format radio button.

Any suggestions?
Thanks!
John

Author:??(---.woh.rr.com)
Date:???06-08-03 22:35

Trying to do a search on a dvd library mysql table using php. The form is like this:



Search


Enter your search criteria:

























































Title:
Category:

Date:
Format:
WideScreen
Standard Format
Cast:
Director, Last Name:
Director, First Name:
Composer, Last Name:
Composer, First Name:
Runtime:
Comments:
Quote:
? ?





The PHP file is like this:
$db_name = "client1";
$table_name = "DVD";
include("header.php");
$db = @mysql_select_db($db_name, $connection) or die("Couldn't select database.");

$query ="SELECT * FROM $table_name WHERE Title LIKE \"%$Title%\" AND Category = \"$Category\" AND Date LIKE \"%$Date%\" AND Format = \"$Format\" AND Cast LIKE \"%$Cast%\" AND Dir_Last LIKE \"%$Dir_Last%\" AND Dir_First LIKE \"%$Dir_First%\" AND Composer_Last LIKE \"%$Composer_Last%\" AND Composer_First LIKE \"%$Composer_First%\" AND Runtime LIKE \"%$Runtime%\" AND Comments LIKE \"%$Comments%\" AND Quote LIKE \"%$Quote%\"";

$total_result = @mysql_query($query) or die("Error #". mysql_errno() . ": " . mysql_error());
$total_found = @mysql_num_rows($total_result);

while ($row = mysql_fetch_array($total_result)) {

$Title=$row['Title'];
$Category=$row['Category'];
$Date=$row['Date'];
$Format=$row['Format'];
$Cast=$row['Cast'];
$Dir_Last=$row['Dir_Last'];
$Dir_First=$row['Dir_First'];
$Composer_Last=$row['Composer_Last'];
$Composer_First=$row['Composer_First'];
$Runtime=$row['Runtime'];
$Comments=$row['Comments'];
$Quote=$row['Quote'];

$display_block .= "
$Title$Category$Date$Format$Cast$Dir_Last$Dir_First$Composer_Last$Composer_First$Runtime$Comments$Quote

?Topics Author? Date
?Trying to get radio buttons and pop-up menus to work??new
John 06-08-03 22:35?
?Re: Trying to get radio buttons and pop-up menus to work??new
bastien 06-09-03 10:11?
Go to Top??|??Go to Topic??|??Flat View??|??Search?
??|??
New Topic
?Reply To This Message
?Your Name:
?Your Email:
?Subject:
Email replies to this thread, to the address above.
??wrote: > > Trying to do a search on a dvd library mysql table using php. > The form is like this: > > > > Search > > >

Enter your search criteria:

>
enctype="multipart/form-data"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Title: size=40 maxlength=255 value="">
Category: > >
Date: size=4 maxlength=255 value="">
Format: > checked>WideScreen > Standard > Format >
Cast: size=40 maxlength=255 value="">
Director, Last Name: size=40 maxlength=255 value="">
Director, First > Name: size=40 maxlength=255 value="">
Composer, Last Name: type="text" size=40 maxlength=255 value="">
Composer, First > Name: type="text" size=40 maxlength=255 value="">
Runtime: size=4 maxlength=255 value="">
Comments: size=40 maxlength=255 value="">
Quote: size=40 maxlength=255 value="">
  name="submit" value="Enter">  name="reset">
>
> > > > The PHP file is like this: > $db_name = "client1"; > $table_name = "DVD"; > include("header.php"); > $db = @mysql_select_db($db_name, $connection) or > die("Couldn't select database."); > > $query ="SELECT * FROM $table_name WHERE Title LIKE > \"%$Title%\" AND Category = \"$Category\" AND Date LIKE > \"%$Date%\" AND Format = \"$Format\" AND Cast LIKE > \"%$Cast%\" AND Dir_Last LIKE \"%$Dir_Last%\" AND Dir_First > LIKE \"%$Dir_First%\" AND Composer_Last LIKE > \"%$Composer_Last%\" AND Composer_First LIKE > \"%$Composer_First%\" AND Runtime LIKE \"%$Runtime%\" AND > Comments LIKE \"%$Comments%\" AND Quote LIKE \"%$Quote%\""; > > $total_result = @mysql_query($query) or die("Error #". > mysql_errno() . ": " . mysql_error()); > $total_found = @mysql_num_rows($total_result); > > while ($row = mysql_fetch_array($total_result)) { > > $Title=$row['Title']; > $Category=$row['Category']; > $Date=$row['Date']; > $Format=$row['Format']; > $Cast=$row['Cast']; > $Dir_Last=$row['Dir_Last']; > $Dir_First=$row['Dir_First']; > $Composer_Last=$row['Composer_Last']; > $Composer_First=$row['Composer_First']; > $Runtime=$row['Runtime']; > $Comments=$row['Comments']; > $Quote=$row['Quote']; > > $display_block .= > "
$Title$Category$Date$Format$Cast$Dir_Last$Dir_First$Composer_Last$Composer_First$Runtime$Comments$Quote

Provided By
Phorum