/** * 获取用户信息 * @param <array> $account 账号密码 * @return 用户信息 */ public function getUser($account) { $dao = new Ym_Dao('default'); $account['password'] = md5(md5($account['password']) . User_Session::LOGIN_SALT); str_replace("'", "", $account['email']); $sql = "SELECT * FROM {$this->userTable} WHERE email = '" . $account['email'] . "' AND password = '******'password'] . "'"; $result = $dao->queryRow($sql, true); return $result; }
public function ip2location($ip) { $dao = new Ym_Dao('ip2location'); $where = "WHERE `ip_from` < {$ip} ORDER BY ip_from DESC LIMIT 1"; $sql = "SELECT `city_name` FROM `ip2location_db24` " . $where; $result = $dao->queryScalar($sql); $dao->selectDb('default'); return $result; }
public function selectDb($db) { self::$dbEnv = $db; }