I've posted this in the mailing.www.php-user newsgroup and wasn't able to find the problem. It is possible that the problem is on the server's side but i doubt that because all my other PHP pages work fine using the same methods as I used on this one. The problem is that I get the following error message even though there is nothing wrong with my code : "Warning: Supplied argument is not a valid MySQL-Link resource in /edge/home/icsl-edgam/htdocs/report.php on line 59"
I'll Give you The whole page below since I don't know where the problem
could possibly be, Also, you can see the output it gives currently by going
to http://icsl.edgegaming.com/report.php . You will see some expressions
with = instead of == , I did that on purpose.
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>International Counter-Strike League -- Report Loss</title>
</head>
<body bgcolor="#000000" text="#FFFF00" link="#00FFFF"
vlink="#008080">
<? virtual("/cgi-bin/ad.pl"); ?>
<h1 align="center">The International Counter-Strike League</h1>
<h2 align="center">Report Loss</h2>
<? include("nav.incl"); ?>
<?
if ($submit)
{
//Process Form
//Get Password info From DB
$db = mysql_connect("localhost", <name>,<pass>);
mysql_select_db("icsl",$db);
$result = mysql_query("SELECT password FROM clans WHERE id='$yourid'",$db);
//Check Password
if ($myrow = mysql_fetch_array($result)) {
if ($password = $myrow['password']) {
$loss = mysql_query("UPDATE clans SET loss=loss+1 WHERE
id='$yourid'",$db);
$win = mysql_query("UPDATE clans SET win=win+1 WHERE id='$oppid'",$db);
} else {
echo "Incorrect Password";
}
} else {
echo "You need to enter a Password";
}
}
?>
<?
$clans = mysql_query("SELECT id, tag FROM clans",$db);
?>
<div align="center">
<br>
<form action="<? echo $phpself; ?>" method="POST">
Your Clan : <select name="yourid">
<?
while ($clanlist = mysql_fetch_array($clans)) {
printf("<option value=\"%s\">%s</option>", $clanlist['id'],
$clanlist['tag']);
}
?>
</select>
<br>
Password : <input type="password" size="20" name="password">
<br>
Opponent : <select name="oppid">
<?
while ($clanlist = mysql_fetch_array($clans)) {
printf("<option value=\"%s\">%s</option>", $clanlist['id'],
$clanlist['tag']);
}
?>
</select><br>
<p><input type="submit" name="submit" value="Submit"><input
type="reset" name="reset" value="Reset"></p>
</form>
</body>
I hope someone can help me, It's driving me nuts!!