Can anyone tel me what's wrong with the following script. I keep getting "Supplied argument is not a valid MySQL result resource". I've tried all kinds but I don't get it!!
$chk_result = mysql_query("SELECT * FROM active_users WHERE username = '$valid_user");
if (mysql_num_rows($chk_result) <1)
{
$login_result = mysql_query("INSERT INTO active_users (username, lastaction) VALUES ('$username', NOW(''))");
}