Sql prob - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Sql prob (
/showthread.php?tid=629339)
Sql prob -
Stop - 25.02.2017
Код:
Error
SQL query: Documentation
CREATE DEFINER=`root`@`localhost` PROCEDURE `login` (IN `username` VARCHAR(24), IN `password` VARCHAR(42), IN `ip` VARCHAR(45), OUT `returncode` VARCHAR(24)) BEGIN
DECLARE user_id INT;
DECLARE user_exist TINYINT;
DECLARE user_ban TINYINT;
DECLARE login_attempts INT;
DECLARE error_code INT;
SET user_id = -1;
SET error_code = 0;
SELECT
COUNT(*)
INTO user_exist
FROM players
WHERE name = username;
IF user_exist = 0 THEN
SET error_code = 10;
END IF;
IF error_code = 0 THEN
SELECT
COUNT(*)
INTO login_attempts
FROM pcp_login_attempt
WHERE (la_name = username
OR la_ip = ip)
AND la_error = 40
AND TIMESTAMPDIFF(MINUTE, la_time, NOW()) <= 10;
IF login_attempts >= 3 THEN
SET error_code = 20;
END IF;
END IF;
IF error_code = 0 THEN
SELECT
COUNT(*)
INTO use[...]
MySQL said: Documentation
#1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation
hoiw to fix this? pls help me bro's / sis's..
Thank you in Advance
Re: Sql prob -
Vince - 25.02.2017
The account you're using doesn't have permission to use the CREATE PROCEDURE statement. It's quite clear, really. You may try removing DEFINER=`root`@`localhost` or replacing it with DEFINER=CURRENT_USER. If that doesn't work and you're on a shared host (i.e. you bought slots) then you're pretty much screwed because it's not likely that you will get the privileges.