(mysql_num_rows(mysql_query("SELECT * FROM users WHERE username LIKE '$username'")) == 0)
if(mysql_num_rows(mysql_query("SELECT * FROM users WHERE username LIKE '$username' AND password='$password'")) > 0) {
//non mettiamo like alla password
$username = mysql_result(mysql_query("SELECT username FROM users WHERE username LIKE '$username'"), 0);
$userid = mysql_result(mysql_query("SELECT id FROM users WHERE username LIKE '$username'"), 0);
mysql_query("UPDATE users SET last_login='".time()."', last_ip='$ip' WHERE id='$userid'") or die(mysql_error());
$_SESSION['username'] = $username;
$_SESSION['userid'] = $userid;
questa è la parte che non capisco...


Rispondi quotando