Hi Everyone,
I have a page that displays information from a mysql database. The information is taken from the members table where the id is in the url e.g. http://www.clancorner.net/tounament.php?go=MW2&id=2. And that works perfectly, pulls ou all the information i asked for. Unfortunatley i now need to just echo "Invalid tournament id" if the id is not in the table members and i have tried numerous thing that just havn't worked. Heres the code i am using at the minute:
<?
if($_GET["go"]=="MW2")
{
$tourneyid = mysql_escape_string($_GET['id']);
$touneyname = mysql_escape_string($_GET['name']);
mysql_connect("localhost","username","pass");
mysql_select_db("tournamentsMW2");
$sql = "SELECT * FROM tournamentsMW2 WHERE id='" . $tourneyid . "'";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
//Set Variables
$name=$r["name"];
$datetime=$r["datetime"];
$buyin=$r["buyin"];
$type=$r["type"];
$mode=$r["mode"];
}
?>
Thanks in advance!