session_start();
$_SESSION['word'] = $_POST['searchbar'];
$search = $_SESSION['word'];
if ($search == "") { //stopping any blank fields
echo "<p align=center><b>Please Enter Something To Search For In The Search Box.</b></p>";
}
else
{
$result = mysql_query("SELECT * FROM clothes WHERE (`title` LIKE '%".$search."%') || (`description` LIKE '%".$search."%')") or die(mysql_error()); //trying to do a statement that asks for a search to be done on TITLE and DESCRIPTION for what ever term someone has searched for so I can show them the results
echo "<p align=center>You Searched For $search</p>"; //showing the term that is being searched
if($result[0] == 0) //checking to see if the results come up as NONE then the following message to be shown
{
echo "<p align=center><b><font size=3>No Results Were Found.</font></b></p>";
}
else
{
//if there are some results from the term then the following tables are shown
echo "results shown here";
}
}
my issue I am having is I am not receiving any results with my OR statement.
The search term shows, the search works without the OR statement but as soon as I try to search the TITLE and DESCRIPTION columns for results it does not like it.
Any help?