AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   DBI Query Help (https://forums.alliedmods.net/showthread.php?t=26721)

nhdriver4 04-08-2006 05:47

DBI Query Help
 
I was working with someone in the forums on using the correct syntax in my plugin, so that it's compatable with various database types.

This is the origional line that I used:
Code:
format(query, 350, "REPLACE INTO %s VALUES ( '%s','%s', '1' )", sql_table, authid, tag)

This is the line that I was told I should use. However, it doesn't update the database, or throw any error.
Code:
format(query, 350, "UPDATE %s SET steamid='%s', tag='%s', toggle='1'", sql_table, authid, tag)

Comments, or suggestions please?

Sandurr 04-08-2006 06:35

Code:
format(query, 350, "UPDATE %s SET tag='%s', toggle='1' WHERE steamid='%s'", sql_table, authid, tag,authid)

nhdriver4 04-08-2006 06:42

Thanks, worked like a charm. Unfortunatly, I can only test on mysql. So, I'll have to wait for feedback from other users, if there are any.

Thanks again.

Sandurr 04-08-2006 08:16

Code:
format(query, 350, "UPDATE %s SET tag='%s', toggle='1' WHERE steamid='%s'", sql_table, tag,authid)

this ones fixed, I forgot to remove the first authid :P

anyways np

nhdriver4 04-08-2006 09:25

Quote:

Originally Posted by Sandurr
this ones fixed, I forgot to remove the first authid :P
anyways np

Yea I cought that. Thanks.


All times are GMT -4. The time now is 16:43.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.