Thats more or less what im trying to achive,
I recive a fair few errors though. I have yet to use mysql_fetch_array, I have done a bit of reading and I tried to implement it myself.
The origial code gave me this error.
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Documents and Settings\Jamie Thompson\My Documents\www\Digitally-United\memberincontest.php on line 6
Warning: Invalid argument supplied for foreach() in C:\Documents and Settings\Jamie Thompson\My Documents\www\Digitally-United\memberincontest.php on line 7
I changed the code abit so I could use GET for the user id,
<?php
$comp = $_GET['comp'];
$mem = $_GET['mem'];
require_once ('connect.php');
$query = "SELECT * FROM `psrelay` WHERE `CID` = $comp";
$result = mysql_query ($query);
if ($result)
{
while ($arr = mysql_fetch_array ($query, MYSQL_ASSOC))
{
foreach ($arr as $check) {
if ($check==$userid) {
echo " You are in the competition: ID $row[CID], Name $row[Name]";
} else {
echo "You are not in competition: ID $row[CID], Name $row[Name] ";
}
}
};
};
?>
Now I get
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\Documents and Settings\Jamie Thompson\My Documents\www\Digitally-United\memberincontest.php on line 9
Could someone give me some adivce on wher I am going wrong as I have yet to come accross this error before.
Thanks.