http://www.copticlist.webatu.com/catg_a ... =ad_S_DATE
i cheked already for this error and they said that may be the query doesn't have data but this is not my case cause if you open the combobox (the query) you will fiend data
and this is the code for the all page:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Ajax Tutorial: Dynamic Loading of ComboBox using jQuery and Ajax in PHP</title>
<script type="text/javascript" src="jquery-1.3.2.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#loader').hide();
$('#show_heading').hide();
$('#search_category_id').change(function(){
$('#show_sub_categories').fadeOut();
$('#loader').show();
$.post("get_chid_categories.php", {
parent_id: $('#search_category_id').val(),
}, function(response){
setTimeout("finishAjax('show_sub_categories', '"+escape(response)+"')", 400);
});
return false;
});
});
function finishAjax(id, response){
$('#loader').hide();
$('#show_heading').show();
$('#'+id).html(unescape(response));
$('#'+id).fadeIn();
}
function alert_id()
{
$city = $('#sub_category_id').val() ;
return false;
}
</script>
<style>
</style>
<link href="css/Main.css" rel="stylesheet" type="text/css" />
</head>
<?php require_once("includes/functions.php"); ?>
<?php require_once("includes/connection.php");
require_once('zipcode.class.php');?>
<body>
<!-- <table width="852" border="0" background="#Ff6600" id="searchtable" align="center" > -->
<div style="padding-left:30px;">
<form class="searchForm" action="catg_ads_disc.php?tablenumb=2&start=0&search_or_no=1&order=ad_S_DATE" method="post" >
<div>
<div class="both">
State
<select name="state" id="search_category_id">
<option value="" selected="selected"></option>
<?php
$query = "select distinct state_name from zip_code ORDER BY state_name ";
$results = mysql_query($query);
while ($rows = mysql_fetch_assoc(@$results))
{?>
<option value="<?php echo $rows['state_name'];?>"><?php echo $rows['state_name'];?></option>
<?php
}?>
</select>
</div>
<div class="both2">
<h4 id="show_heading"><img src="loader.gif" style="margin-top:8px; float:left" id="loader" alt="" /></h4>
<div id="show_sub_categories" align="center"></div>
</div>
</div>
</div>
<div>
<table width="852" border="0" background="#Ff6600" id="searchtable" align="center">
<tr>
<td colspan="2" align="left">Search for: </td>
<td colspan="7" align="left"><input name="disc" size="68" type="text"/></td>
<td colspan="2">Model</td>
<td colspan="4"><select name="model">
<?php
$cars_models=select_cars_models(cars_models);
$model = mysql_fetch_assoc($cars_models);
do {
?>
<option value="<?php echo $model['cars_marke_code']?>"><?php echo $model['cars_model_name']?></option>
<?php
} while ($model = mysql_fetch_assoc($cars_models));
$models = mysql_num_rows($model); /////// this is the error
if($models > 0) {
mysql_data_seek($model, 0);
//$row_Recordset1 = mysql_fetch_assoc($model);
}
?>
</select></td>
</tr>
<tr>
<td width="62">Year</td>
<?php
$yearRange = 100; ////// preview the list of the min year for 100 year
$thisYear = date('Y');
$startYear = ($thisYear - $yearRange);
// echo $startYear ;echo $thisYear ;
echo "<td colspan=\"2\"><select name=\"min_year\" id=\"min_year\">";
$years = (range($startYear, $thisYear));
foreach ($years as $year) {
echo "<option value=$year>$year</option> " ;
}
echo"</select></td>";
?>
<td width="6"><strong>:</strong></td>
<?php ////// preview the list of the max year for 100 year
$yearRange = 100;
$thisYear = date('Y');
$startYear = ($thisYear - $yearRange);
echo "<td width=\"63\"><select name=\"max_year\" id=\"max_year\">";
foreach (range($thisYear,$startYear) as $year) {
echo "<option value=$year>$year</option> " ;
}
echo"</select></td>";?>
<td width="46">Mileage</td>
<td width="64"><input name="min_mileage" type="text" size="10"/> </td>
<td width="4"><strong>:</strong></td>
<td><label>
<input type="text" name="max_mileage" id="max_mileage" size="10">
</label></td>
<td colspan="2">Price</td>
<td width="60"><input name="min_price" type="text" size="10" /></td>
<td width="5"><strong>:</strong></td>
<td width="60"><input name="max_price" type="text" size="10" /></td>
<td width="115"> </td>
</tr>
<tr>
<td colspan="6" >
<label>
<input type="checkbox" name="has_pic" value="1" id="has_pic_0" checked= checked >
Has Pic</label></td>
<td align="center" colspan="4">
<label>
<input type="checkbox" name="only_titel" value="1" id="has_pic_0" checked= checked>
Search Only on The Titel </label></td>
<td width="46"><input type="hidden" name="search_or_no" value="2"/></td>
</tr>
<td colspan="14" align="right"><input name="submit" type="submit" id="submit" value=" Search For Autos "></td>
</tr>
</table>
</form>
</html>