With the following code I can search with an explicit ####-##-###-### number (that number equals $finalstr) and receive the appropriate record from my db however if I only enter a 5 for instance in the first text field and submit...the script returns a blank page how can I do wild card searches?
<?php
$db = mysql_connect("127.0.0.1", "client", "");
mysql_select_db("Military_Catalog",$db);
$str1="$start";
$str2="$second";
$str3="$third";
$str4="$fourth";
$finalstr=$str1 . "-" . $str2 . "-" . $str3 . "-" . $str4;
$sql_events = mysql_query("SELECT partnum , nsn , description , top_level_kit , eng_used_on FROM partslist WHERE 1 AND nsn LIKE '$finalstr' LIMIT 0 , 30 ") or die (mysql_error());
while ($row = mysql_fetch_array($sql_events)) {
$partnum = $row["partnum"];
$nsn = $row["nsn"];
$top_level_kit = $row["top_level_kit"];
$description = $row["description"];
$eng_used_on = $row["eng_used_on"];
echo"
<p>
Part Number: $partnum<br />
NSN: $nsn<br />
Top Level Kit: $top_level_kit<br />
Description: $description<br />
Engine Used On: $eng_used_on
</p>
<hr noshade>
";
}
?>