This is my search php code, it's working fine, but I want to return the link of the game. In this code I'm able to see the game name when I hit search, but I want to see my gamelist depending on what I'm searching for. What do I have to do to display the game instead of returning only its name? thanks
table `jogos`
--
CREATE TABLE IF NOT EXISTS `jogos` (
`idGames` int(11) NOT NULL AUTO_INCREMENT,
`strNome` varchar(100) DEFAULT NULL,
`strSeo` varchar(100) DEFAULT NULL,
`intCategoria` int(11) DEFAULT NULL,
`strImage` varchar(50) DEFAULT NULL,
PRIMARY KEY (`idGames`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
INSERT INTO `jogos` (`idGames`, `strNome`, `strSeo`, `intCategoria`, `strImage`) VALUES
(4, 'Quake', 'Quake', 1, 'Folder.jpg');
--
<?php
if (isset($_GET['query'])){
$query = $_GET['query'];
$min_length = 3;
if(strlen($query) >= $min_length){
$query = htmlspecialchars($query);
$query = mysql_real_escape_string($query);
$raw_results = mysql_query("SELECT * FROM jogos
WHERE (`strNome` LIKE '%".$query."%')") or die(mysql_error());
if(mysql_num_rows($raw_results) > 0){ // if one or more rows are returned do following
while($results = mysql_fetch_array($raw_results)){
echo "<p>".$results['strGame']."</p>";
}
}
else{ // if there is no matching rows do following
echo "No results";
}
}
else{ // if query length is less than minimum
echo "Minimum length is ".$min_length;
}
}
?>
</body>
</html>
<?php
mysql_free_result($GameData);
?>