[SQL]Only insert if not already exists
Hi, im making a plugin with the SQLx module and it connects fine.
But, im getting duplicate entries, i made it so it adds 1 entry with the server ip in the plugin_init, but everytime i restart or do a map change a duplicate entry is created in the database. How do i fix that? Current Code: PHP Code:
To make it clear: I dont want to insert the IP if the IP already exists in the DB. |
Re: [SQL]Only insert if not already exists
Make IP field an unique key.
|
Re: [SQL]Only insert if not already exists
Done, thanks it works ..
Another Q though, it gives me index out of bounds warning at line 125. Line 125: PHP Code:
EDIT: ip_field->Primary Key works. |
| All times are GMT -4. The time now is 03:43. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.