AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Sql syntax working...sometimes (https://forums.alliedmods.net/showthread.php?t=156106)

zeus 05-01-2011 05:12

Sql syntax working...sometimes
 
PHP Code:

new szTemp512 ]
    
    
formatexszTempcharsmaxszTemp ),
    
"INSERT INTO `%s` ('name','password','email','status') VALUES ('%s','%s','%s','Online')"gTng_szNameid ], g_szPasswordid ], g_szEmailid ] )
    
    
SQL_ThreadQueryg_SqlTuple"IgnoreHandle"szTemp 

The thing is that most of the time it works
But when I check the database there are some rows where there is no password
g_szPassword[ id ] is allways alphanumeric ( md5 hash )
The column size for the password is correct varchar(32)
It parses the name corectly, the email and the status but the password sometimes not
Any ideas?

Hunter-Digital 05-01-2011 06:57

Re: Sql syntax working...sometimes
 
Well, you could add a fail check, check if strlen(g_szPassword[id]) > 0 and log an error... or if it's not that frequently called, you should log every insert and see where it doesn't insert it.

zeus 06-16-2011 03:48

Re: Sql syntax working...sometimes
 
Found the problem :D
formatex does not perform a "copy back" check.

Hunter-Digital 06-16-2011 12:01

Re: Sql syntax working...sometimes
 
Yes it doesn't... but you don't have a copyback in that code.

zeus 06-16-2011 15:13

Re: Sql syntax working...sometimes
 
Oh well...I'll wait and see
If it happens again with format I'll probably suicide :shock:


All times are GMT -4. The time now is 04:22.

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