no concat in postgres, use pipes

This commit is contained in:
Shish 2010-02-01 16:15:25 +00:00
parent ad83c7634c
commit 69001a375c

View file

@ -40,7 +40,7 @@ class User {
public static function by_session($name, $session) {
global $config, $database;
$row = $database->get_row(
"SELECT * FROM users WHERE name = ? AND md5(concat(pass, ?)) = ?",
"SELECT * FROM users WHERE name = ? AND md5(pass || ?) = ?",
array($name, get_session_ip($config), $session)
);
return is_null($row) ? null : new User($row);