如果有人可以为我提供正确的代码,那就太好了。我要做的是<hr />
在仅当从我的数据库中提取多个结果时才在回显的信息之后添加一个。如果有人可以帮助我,这是代码。谢谢。
<html>
<script>
function goBack()
{
window.history.back()
}
</script>
<body>
<div style="width: 875px; margin-left: 30px; margin-right: auto;"><img src="searchresults.png" alt="" title="Search Results" alt="" /></p>
<?php
$term = $_POST['term'];
$sql = mysql_query("SELECT * FROM store_location where store_name like '%$term%' or address like '%$term%' or city like '%$term%' or state like '%$term%' or zip like '%$term%' or phone like '%$term%' or fax like '%$term%' or email like '%$term%' or url like '%$term%' ");
if( mysql_num_rows($sql) == 0) echo "<p>No TeachPro Store(s) in your area.</p>";
while ($row = mysql_fetch_array($sql)){
echo 'Store Name: '.$row['store_name'];
echo '<br/> Address: '.$row['address'];
echo '<br/> City: '.$row['city'];
echo '<br/> State: '.$row['state'];
echo '<br/> Zip: '.$row['zip'];
echo '<br/> Phone: '.$row['phone'];
echo '<br/> Fax: '.$row['fax'];
echo '<br/> Email: <a href="mailto:'.$row['email'].'">'.$row['email'].'</a>';
echo '<br/> URL: <a href="'.$row['url'].'">'.$row['url'].'</a>';
echo '<br/><br/>';
}
?>
</div>
<input type="button" value="Back" onclick="goBack()">
</body>
</html>