Hey,
it's basically like a if statment.. that if a row is found with the status of NOT closed and the user name is found in either user1 or user2 field it will return a mysql_num_row of 1 or more. and if that happanes it prevents the rest of the script from going through.
but it does not see to be working and the mysql_error() does not return anything....
here is the code.
/lets get the datbase information!
require('/homepages/13/d153872232/htdocs/nightlance.com/match/main_mysql.php'); // main databse
$sql="SELECT db_name, status from Events where name='$event'";
$q=mysql_query($sql, $db) or $error=("Error when trying to get the databse name from the main datbase!<br>".mysql_error());
$r=mysql_fetch_assoc($q);
if(isset($error))
{
echo '<center id="error">'.$error.'</center>';
}
$database=$r['db_name'];
$event_status=$r['status'];
//lets see if they are in any matches
$search_string=("SELECT * from ".$database."_match where status NOT LIKE Closed and user1='$username' OR user2='$username'"); //here is where the error is
$search_query=mysql_query($search_string, $events) or $error=('Error when trying to see if you are currently in a match <br />'.mysql_error());
$search_result=mysql_num_rows($search_query);
if($search_result !== '0')$stop='Yes';
echo $search_string;
if(isset($error))
{
echo '<center id="error">'.$error.'</center>';
}