Well i decided illd go ahead with my game releated search thing, and ive came accross my first bug which i have no idea to fix it, ok so lemme explain :
A user types in a games name, into a textbox, he clicks search, and the results pop up.. thats fine right? BUT IT ISNT XD now im getting to the point. If someone types a games name and we dont have stuff for that game, a blank page appears, how do i make it say " sorry no information found" .. i no it must be easy.. but i cant figure it out..
here's the current code :
<?
//connect to mysql
//change user and password to your mySQL name and password
mysql_connect("localhost","*****","******");
//select which database you want to edit
mysql_select_db("cheats");
$search=$_POST["search"];
//get the mysql and store them in $result
//change whatevertable to the mysql table you're using
//change whatevercolumn to the column in the table you want to search
$result = mysql_query("SELECT * FROM cheat WHERE title LIKE '%$search%'");
//grab all the content
while($r=mysql_fetch_array($result))
{
//the format is $variable = $r["nameofmysqlcolumn"];
//modify these to match your mysql table columns
$title=$r["title"];
$message=$r["cheat"];
$who=$r["website"];
$date=$r["date"];
//display the row
echo "$title <br> $message <br> $who <br> $date";
}
?>
