This is what i have so far:
It is for a login script, so it is to check if the value of 2 cookies is the same as in the database, and that there is only 1, so if it is all correct it will return 1, that is if it worked the way i wanted it to. If say i had a form and it was sent to this page, and i put $username (global variable for the form name) where $_cookie['somethinghere'] was, it would work, though with the cookie it doesn't seem to.
$result = mysql_query("SELECT * FROM users WHERE username = '$_cookie["cookiename"]' AND password = '$_cookie["cookiepassword"]'");
$user = mysql_num_rows($result);
if ($user == "1")
{
echo ('You are logged in');
}
else
{
echo ('You are logged out');