05-10-2009, 02:01 PM
|
#22 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Sorry here's the code......
PHP Code:
<?php
$origPC = $_POST['postcode'];
$postcode= strtoupper($origPC);
$first_list = array();
$con=mysql_connect(localhost, "#####", "#####");
mysql_select_db("######");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$sql = "SELECT cat_name, postcode FROM postalcode WHERE status='sold'";
$qry = mysql_query($sql);
echo "Sold Items: <br />";
if (mysql_num_rows($qry) > 0) {
while ($rs = mysql_fetch_assoc($qry)) {
$cat_name = $rs['cat_name'];
$postcode = $rs['postcode'];
$first_list[] = $cat_name;
echo $cat_name.'<br/>';
}
} else {
print '<h4>no result found</h4>';
}
print '<form method="POST" action="index.php?ID=15">';
echo "<br />Available Items: <br />";
$query="SELECT DISTINCT cat_name FROM category GROUP BY cat_name";
$result = mysql_query ($query);
echo "<select name='cat_name' value=''>";
echo "<option value=''>View Other Categories</option>";
while($nt=mysql_fetch_array($result))
{
$kitty=$nt[cat_name];
if(!in_array($kitty,$first_list)) {
echo "<option value=''>$kitty</option>";
}
}
echo "</select><br/>";
print '<input type="submit" value="Contact Us for More Information"> </form>';
?>
|
|
|
|