Hiiii,Good Evening
I have a code that search for data in the database but I can search for only 1 keyword in a time,which is working fine for single keyword. if I type 2 keywords separated by a space or comma's which return blank page. I would like to modify it so I can search for multiple keywords which is separeted by commas.
Here is my code
<?php
mysql_connect("localhost" , "root" , "") or die(mysql_error());
mysql_select_db("keyword") or die(mysql_error());
if($_POST['submit'])
{
$keyword=$_POST['keyword'];
$keyword = mysql_real_escape_string( trim($_POST['keyword']));
$sql="SELECT title FROM search WHERE keyword LIKE '%$keyword%'";
$query=mysql_query($sql);
while($row = mysql_fetch_assoc($query))
{
$title =$row['title'];
echo "$title<br/>";
}
}
?>
please help me.