Ok I am doing a simple thing. i am selecting an item from a dropdown menu thats pulled from a database i select an item and click search, now this should pull the selected query out of the type field which it kinda does.
But it says there is say..2 results but only displays the echo statments of like
company name:
address:
etc and not the results from the database.
ok heres the script
if($company_name or $f_type)
{
$query="SELECT * FROM companies WHERE";
if ($f_type!="")
{
$query.=" type LIKE '%$f_type%'";
}
$query.="order by company_name";
$numberOfResults=mysql_num_rows(mysql_query($query));
$query.=" LIMIT $pos,$amount";
if ($numberOfResults=="1")
{
echo "Found $numberOfResults match.";
}
else
{
echo "Found $numberOfResults matches.";
}
echo "<hr noshade width=\"40%\">";
$res=mysql_query($query);
thats the query
i try and display it like....
while ($result=mysql_fetch_array($res))
{
?>
<tr>
<td><font face="verdana" size="2"><b><?=$result["company_name"]?></b></font></td>
</tr>
<tr>
<td>
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><font face="verdana" size="2"><?=$result["address1"]?></font></td>
</tr>
the results are blank altho it is querying the database and the database is populated.
any help would be greatly recieved if you want any more information please let me know.
Thanks.