prepare('SELECT * FROM myusers WHERE un = ? AND pw = ?'); $stmt->bind_param('ss', $un, $pw); $stmt->execute(); $rs = $stmt->get_result(); $res = $rs->fetch_array() != false; $rs->close(); $stmt->close(); $con->close(); return $res; } function xisvalid($un, $pw) { return isvalid($un, $pw) ? "OK" : "not OK"; } echo xisvalid('anonymous', '') . "\r\n"; echo xisvalid('arne', 'hemmeligt') . "\r\n"; echo xisvalid('arne', "x' OR 'x' = 'x") . "\r\n"; ?>