I have setup my own search on my games website, it searches keywords that I store in my database under the name 'tags'.
Now... If I store a 'tag' as say pacman, and search 'pacman' it comes up, but if I search 'pacman game' it doesn't find it because I only stored it as 'pacman'. So what I want help with really is setting it so that the search results don't have to be so specific, any one of the search keywords are found under 'tag' in the DB it will show the results...
My code is something like this:
Code: Select all
<?php
$search = mysql_real_escape_string($_GET['search']);
// Performing SQL query
$query = "SELECT * FROM games WHERE tags = '$search' ORDER BY id DESC";
$result = mysql_query($query) or die('Query failed: ' . mysql_error());