AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   SQL_ReadResult error (https://forums.alliedmods.net/showthread.php?t=326883)

jugule 08-21-2020 17:33

SQL_ReadResult error
 
Hi, I also have a problem with the 'SQL_ReadResult' function, this function is to see if the player in the database has VIP.

The column in the database is called: vip.


Error:
PHP Code:

08/22/2020 00:26:00: [MySQLInvalid column: -1
08
/22/2020 00:26:00: [AMXXDisplaying debug trace (plugin "test.amxx")
08/22/2020 00:26:00: [AMXXRun time error 10native error (native "SQL_ReadResult")
08/22/2020 00:26:00: [AMXX] [0test.sma::register_client (line 7771


Shadows Adi 08-21-2020 18:08

Re: SQL_ReadResult error
 
The error may be in the results from the sql, the columns are wrong.

jugule 08-21-2020 18:13

Re: SQL_ReadResult error
 
Quote:

Originally Posted by Shadows Adi (Post 2715055)
The error may be in the results from the sql, the columns are wrong.

in sql :
table: players : colum is vip (value 1 = vip / value 0 = no vip)
whats are wrong?

Shadows Adi 08-21-2020 18:25

Re: SQL_ReadResult error
 
Then try to change this:
Code:
 g_vip[id] = SQL_ReadResult(Query, vip3);
in
Code:
 g_vip[id] = SQL_ReadResult(Query, /*Column Number*/);
I mean, avoid this:
PHP Code:

new vip3 SQL_FieldNameToNum(Query"vip"); 


jugule 08-21-2020 18:36

Re: SQL_ReadResult error
 
Quote:

Originally Posted by Shadows Adi (Post 2715059)
Then try to change this:
Code:
 g_vip[id] = SQL_ReadResult(Query, vip3);
in
Code:
 g_vip[id] = SQL_ReadResult(Query, /*Column Number*/);
I mean, avoid this:
PHP Code:

new vip3 SQL_FieldNameToNum(Query"vip"); 


same problem.

Shadows Adi 08-21-2020 19:13

Re: SQL_ReadResult error
 
Provide more code.

jugule 08-21-2020 22:50

Re: SQL_ReadResult error
 
solved.

ZaX 08-22-2020 07:55

Re: SQL_ReadResult error
 
And how did you solve it? Post the solution because other people might have the same issue


All times are GMT -4. The time now is 13:56.

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