I have a problem, as you probably understand from the topic title
Anyways i have a website where i display "recent searches" and i dont want the same searches to show up at the same time, for example sometimes someone would search for "something random" and probably hits enter like 10 times, that dont look so good on my site... I have tryed to figure this out using google for the past hours... But nothing seems to work, ill include the table ill use for the searches:
Code:
CREATE TABLE `search` (
`id` bigint(20) NOT NULL auto_increment,
`title` varchar(40) default NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3708 ;
and the code i use to insert into this table:
PHP Code:
if($_POST['q']){
$searchtitle = $_POST['q'];
$Fix = array("<", ">", "#", "{", "}", "//");
$searchtitle = str_replace($Fix, "", $searchtitle);
$insertSQL = "insert into search (title) values ('$searchtitle')";
mysql_query($insertSQL);
}
?>
Any help would be very welcome, before i go
Bookmarks