Guys i am going crazy here I dont know what I am doing wrong here, it renders in blank the page.
I apreciatte very much your help.
Oma
<?php
//include("functions.php");
//dbConnect();
//ADD YOUR OWN DB CONNECTION HERE
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
<meta name="generator" content="Adobe GoLive" />
<title>cr1_search</title>
</head>
<body>
<table border="0" cellspacing="0" cellpadding="10">
<tr>
<FORM name="search" METHOD="POST" >
<td align="left" valign="middle"><select name="application" size="1"
onchange="this.form.submit()">
<option value="" <?php checkSelection($application,"");?>>- Select -</option><?php $sql = "SELECT * FROM application ORDER BY application_name"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) {
$sql1 = "SELECT count(*) AS num_results FROM model WHERE suspension_id LIKE '%$row[application_id]%' ";
$result1 = mysql_query($sql1);
$count = mysql_fetch_array($result1);
$num_of_results = $count[num_results];
?>
<option value="<?=$row['application_id']?>" <?php checkSelection($_POST['application'],$row['application_id']);?>><?=$row['app
lication_name'].' ('.$num_of_results.')';?></option><?php } ?>
</select></td>
<td align="left" valign="middle"><?PHP if ($_POST[application] != '') { ?><select name="manufacturer" size="1" onchange="this.form.submit()">
<option value="" <?php
checkSelection($manufacturer,"");?>>- Select -</option><?php //$sql = "SELECT DISTINCT manufacturer.manufacturer_name,manufacturer.manufacturer_id FROM manufacturer,product WHERE manufacturer.manufacturer_id = product.manufacturer_id AND product.application_id LIKE '%$_POST[application]%' ORDER BY manufacturer_name"; $sql = "SELECT * FROM manufacturer ORDER BY manufacturer_name"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) {
$sql1 = "SELECT count(DISTINCT model_name) AS num_results FROM model WHERE manufacturer_id LIKE '%$row[manufacturer_id]%' AND suspension_id = '$_POST[application]' ";
$result1 = mysql_query($sql1);
$count = mysql_fetch_array($result1);
$num_of_results = $count[num_results];
?>
<option value="<?=$row['manufacturer_id']?>"
<?php
checkSelection($_POST['manufacturer'],$row['manufacturer_id']);?>><?=$row['m
anufacturer_name'].' ('.$num_of_results.')';?></option><?php } ?>
</select><?PHP
}
?></td>
<td align="left" valign="middle"><?PHP if ($_POST[manufacturer] != '' AND $_POST[application] != '') { ?><select name="model" size="1" onchange="this.form.submit()">
<option value="" <?php
checkSelection($model,"");?>>- Select -</option><?php $sql = "SELECT DISTINCT model_name FROM model WHERE manufacturer_id = '$_POST[manufacturer]' AND suspension_id = '$_POST[application]' ORDER BY model_name"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) {
//$sql1 = "SELECT count(*) AS num_results FROM product WHERE model_id LIKE '%$row[model_id]%' ";
//$result1 = mysql_query($sql1);
//$count = mysql_fetch_array($result1);
//$num_of_results = $count[num_results];
?>
<option value="<?=$row['model_name']?>" <?php checkSelection($_POST['model'],$row['model_name']);?>><?=$row['model_name'];
?></option><?php } ?>
</select><?PHP
}
?></td>
<td align="left" valign="middle"><?PHP if ($_POST[manufacturer] != '' AND $_POST[application] != ''AND $_POST[model] != '') { ?><select name="year" size="1" onchange="this.form.submit()">
<option value="" <?php
checkSelection($year,"");?>>- Select -</option><?php $sql = "SELECT year_name,model_id FROM model WHERE model_name = '$_POST[model]' ORDER BY year_name"; $result = mysql_query($sql); while ($row = mysql_fetch_array($result)) {
//$sql1 = "SELECT count(*) AS num_results FROM product WHERE year_id LIKE '%$row[year_id]%' ";
//$result1 = mysql_query($sql1);
//$count = mysql_fetch_array($result1);
//$num_of_results = $count[num_results];
?>
<option value="<?=$row['model_id']?>" <?php checkSelection($_POST['year'],$row['model_id']);?>><?=$row['year_name'];?></
option><?php } ?>
</select><?PHP
}
?></td>
</FORM></tr>
</table>
<?PHP
if ($_POST[year] != '') {
$sql2 = "SELECT * FROM product WHERE model_id LIKE '%$_POST[year]%' ";
$result2 = mysql_query($sql2);
if ($result2 == TRUE) {
while ($info = mysql_fetch_array($result2)) {
?>
<table width="180" border="1" cellspacing="2" cellpadding="0">
<tr>
<td>Image</td>
<td>Description</td>
<td>Option</td>
</tr>
<tr>
<td><a title="<?=$info['product_name']?>"
href="<?=$info['large_pic']?>" target="_new"><img
src="<?=$info['small_pic']?>" border="0"></a></td>
<td><?=$info['product_name'];?></td>
<td></td>
</tr>
</table>
<?PHP
}
}
if ($result2 == FALSE) {
$search_error = "Sorry no products are currently available for your search."; }
}
?><?=$search_error;?>
</body>
</html>