Forum Moderators: coopster
"User1,User2,User3,User4,Use..."
and I really need a code to check if a certain Username is in the list.
I've already tried using this;
$result2 = mysql_query("SELECT * FROM stuff WHERE id='$id' ") or die(mysql_error());
while($r2 = mysql_fetch_array($result2))
{
$username = "User1";
$users = $r2['users'];
if (str_replace($username,"#",$users)) {
$exists = "yes"; } else { $exists = "no";
}
Help on this would be greatly appreciated
$result2 = mysql_query("SELECT * FROM stuff WHERE id='$id' ") or die(mysql_error());
$r2 = mysql_fetch_array($result2);
$username = "User1";
$users = [url=http://www.php.net/explode]explode[/url](',',$r2['users']);
if ([url=http://www.php.net/array-key-exists]array_key_exists[/url]($username, $users))
{
$exists = "yes";
} else {
$exists = "no";
}