Function Help
Hi.
I've done a plugin that logs nick, authid,ip to a database ... But when the player join again, the ip etc is inserted again, then i have duplicate results... Can you help with a function that checks before doing the query if the nickname is in the database? Here is partial code: Code:
public client_putinserver(id){ |
Re: Function Help
You have to check if there is an entry with that steamid before you send an insert.
Means: PHP Code:
PHP Code:
|
Re: Function Help
Do _not_ perform two queries. Use the following:
http://dev.mysql.com/doc/refman/5.1/...duplicate.html For an in-depth example look at the provided link. Edit: Also, you do not need to repeat the SET statement all the time, Schwabba. Look here: http://dev.mysql.com/doc/refman/5.1/en/update.html Edit2: If you have a where-clause restricting the query to a specific protocol, you don't need to update these, since it has no effect. |
Re: Function Help
Quote:
|
Re: Function Help
Quote:
|
| All times are GMT -4. The time now is 10:22. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.