mysql - results.php shows all old queries -
mysql - results.php shows all old queries -
i created website search bar using php mysql, results page shows old queries. tried other computers , search queries still appear. not have duplicate keywords should not issue. how can results page dump old queries?
<?php $input = $_get['input'];//note self $input in name of search feild $terms = explode(" ", $input); $query = "select * search "; foreach ($terms $each){ $i++; if ($i == 1) $query .= "keywords '%$each%' "; else $query .= "or keywords '%$each%' "; } // connecting our mysql database mysql_connect("localhost", "pti_user", "policetech1"); mysql_select_db("pti_db"); $query = mysql_query($query); $numrows = mysql_num_rows($query); if ($numrows > 0){ while ($row = mysql_fetch_assoc($query)){ $id = $row['id']; $title = $row['title']; $description = $row['description']; $keywords = $row['keywords']; $link = $row['link']; echo "<h2><a href='$link'>$title</a></h2> $description<br /><br />"; } } else echo "no results found \"<b>$input</b>\""; // disconnect mysql_close(); ?> php mysql
Comments
Post a Comment