Is there anything wrong with that query?
#1

Код:
	mysql_format(SQL, query, sizeof query, "UPDATE `users` SET `ip` = %s, `money` = %d, `admin` = %d, `vip` = %d, `vipdate` = %d, `world` = %d WHERE `id` = %d LIMIT 1", pInfo[playerid][IP], pInfo[playerid][Money], pInfo[playerid][Admin], pInfo[playerid][VIP], pInfo[playerid][VIPDate], pInfo[playerid][World], pInfo[playerid][ID]);
	mysql_tquery(SQL, query);
debug:
Код:
UPDATE `users` SET `ip` = 127.0.0.1, `money` = 0, `admin` = 0, `vip` = 0, `vipdate` = 0, `world` = 1 WHERE `id` = 17 LIMIT 1


It sets everything fine but world stays '0' for some reason.
Help?

EDIT: Noticed that error now. Ideas?
Код:
[plugins/mysql] error #1064 while executing query "UPDATE `users` SET `ip` = 127.0.0.1, `money` = 0, `admin` = 0, `vip` = 0, `vipdate` = 0, `world` = 1 WHERE `id` = 17 LIMIT 1": You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '.0.1, `money` = 0, `admin` = 0, `vip` = 0, `vipdate` = 0, `world` = 1 WHERE `id`' at line 1
Reply
#2

SET `ip` = '%s' String must have apostrohes, and check if the query size is big enought
srry for poor english.

Edit: Now i realise the debug line, its big enought.
Reply
#3

Quote:
Originally Posted by Banditul18
Посмотреть сообщение
SET `ip` = '%s' String must have apostrohes, and check if the query size is big enought
srry for poor english.

Edit: Now i realise the debug line, its big enought.
Thanks for the attempt though.
Any other ideas? Does anyone see what I don't?
Reply
#4

Wrap %s with single quotes (') - ip field.
Reply
#5

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
Wrap %s with single quotes (') - ip field.
That works. Thanks mate
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)