Account deletion problem
#1

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.
Reply
#2

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
Reply
#3

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.
Reply
#4

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?
Reply
#5

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.
Reply
#6

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

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

Bump.
Reply
#9

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)