SA-MP Forums Archive
Account deletion problem - 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: Account deletion problem (/showthread.php?tid=394460)



Account deletion problem - Luis- - 22.11.2012

Hi, it's been a while since I posted here but, here goes. I'm having a problem with "DELETE FROM", i'm using BlueG's R7 MySQL Plugin, can anyone see anything wrong with this code;
Код:
// 24 Day Account Deleter.
forward AccountDeleter();
public AccountDeleter() {
	new Timestamp = gettime() - (60*60*23*24-1053);
	new Query[150];
	format(Query, sizeof(Query), "DELETE FROM `accounts` WHERE `LastLogged` < %d", Timestamp);
	mysql_function_query(Connect, Query, false, "", "");
	print(Query);
	printf(SERVER_NAME " - %d accounts have been deleted in todays account clean.", mysql_affected_rows(Connect));
	return 1;
}
The sql code does work cause i've tried it on phpmyadmin and it worked perfectly.

Thanks.


Re: Account deletion problem - ReneG - 22.11.2012

I think you have to specify what you want to delete. (but that doesn't explain why it would work in phpmyadmin)

Код:
DELETE * FROM `accounts` WHERE `LastLogged` < %d



Re: Account deletion problem - Vince - 22.11.2012

Once again I must say that you cannot fetch a result directly after executing a query if using the R7 plugin. You MUST use a callback in this case as well.


Re: Account deletion problem - Luis- - 22.11.2012

After adding in a callback, it isn't functioning at all, well the print part isn't showing on my console. I'm not fetching a result, am I?


Re: Account deletion problem - AndreT - 22.11.2012

You're in the unclear by using mysql_affected_rows directly after calling mysql_function_query as the query itself might not have executed yet.


Re: Account deletion problem - Luis- - 23.11.2012

Ah, I see. Question is, why wont it work?! It's bloody bugging me, I honestly have no idea.


Re: Account deletion problem - Luis- - 23.11.2012

I still need help with this, any help would be appreciated!


Re: Account deletion problem - Luis- - 25.11.2012

Bump.


Re: Account deletion problem - JJones432 - 26.11.2012

Quote:
Originally Posted by VincentDunn
Посмотреть сообщение
I think you have to specify what you want to delete.
Try adding * after DELETE on RealCop228's code.


Re: Account deletion problem - Scenario - 26.11.2012

Quote:
Originally Posted by JJones432
Посмотреть сообщение
Try adding * after DELETE on RealCop228's code.
You observant mother fucker... Thanks for catching that!