AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Solved Admin base sql edited. (https://forums.alliedmods.net/showthread.php?t=312123)

Kommendante 11-17-2018 07:00

Admin base sql edited.
 
I've took the time to edit this source, now i am getting an error.

Edited source: https://pastebin.com/SMHq5a2e

Now i am getting this error in console.
Code:

[AMXX] SQL Error: failed to load admins: : 'Unknown column 'nickname' in 'field list''
So i know that adding an extra column it's failing to add admin but why, when i recompile the code i haven't any errors.

Any tips boys?

Kushfield 11-17-2018 12:42

Re: Admin base sql edited.
 
As the error states, your admins table lacks a column called "nickname". I see in your code that in the CREATE TABLE code you do indeed add a column called "nickname", so that probably means your database still has the default table from before you made those changes. You can either delete the table so that it gets created correctly by the plugin again, or you can edit the table manually to include that column.

Kommendante 11-18-2018 04:45

Re: Admin base sql edited.
 
With the untouched version is creating the table by itself, with the edited version it's giving errors and i've created the table in database manualy.Something must be wrong in the code, even if i added the column to table in plugin and database smtgh must be wrong.

proof with untouched version
https://prnt.sc/ljs80r


------------------------
Did some modifications, added a var in the function and now is creating an empty table with the columns but not nickname.
source https://pastebin.com/DBwpCTnr

proof: https://prnt.sc/ljsbkr


Where i am doing wrong?

Kushfield 11-18-2018 05:56

Re: Admin base sql edited.
 
I can see 2 problems with the code after a quick look:

Line 244 - You have the access flags and nickname parameter switched up:
PHP Code:

AddAdmin(idauthnicknameflagspasswordtypeComment

Line 257:
PHP Code:

AddAdmin(idauth[], accessflags[], nickname[], password[], flags[], comment[]=""

Line 338 - Here you specify 5 columns to add, but only 4 values for them. This would result in an error and nothing gets added:
PHP Code:

SQL_QueryAndIgnore(sql"REPLACE INTO `%s` (`auth`, `nickname`, `password`, `access`, `flags`) VALUES ('%s', '%s', '%s', '%s')"tableauthnicknamepasswordaccessflagsflags


Kommendante 11-18-2018 06:27

Re: Admin base sql edited.
 
Dammit 26 errors.

Code:

admin.sma(244) : error 088: number of arguments does not match definition
admin.sma(257) : error 010: invalid function or declaration
admin.sma(257) : error 017: undefined symbol "password"
admin.sma(265) : error 010: invalid function or declaration
admin.sma(272) : error 025: function heading differs from prototype
admin.sma(273) : error 021: symbol already defined: "get_configsdir"
admin.sma(273) : error 035: argument type mismatch (argument 1)
admin.sma(275) : warning 209: function "get_configsdir" should return a value
admin.sma(275) : error 010: invalid function or declaration
admin.sma(278) : error 010: invalid function or declaration
admin.sma(287) : error 010: invalid function or declaration
admin.sma(289) : error 010: invalid function or declaration
admin.sma(290) : error 010: invalid function or declaration
admin.sma(292) : error 010: invalid function or declaration
admin.sma(294) : error 010: invalid function or declaration
admin.sma(295) : error 010: invalid function or declaration
admin.sma(297) : error 010: invalid function or declaration
admin.sma(300) : error 010: invalid function or declaration
admin.sma(307) : error 010: invalid function or declaration
admin.sma(311) : error 010: invalid function or declaration
admin.sma(317) : error 010: invalid function or declaration
admin.sma(320) : error 054: unmatched closing brace
admin.sma(324) : error 021: symbol already defined: "get_cvar_string"
admin.sma(328) : error 010: invalid function or declaration
admin.sma(333) : error 010: invalid function or declaration
admin.sma(335) : error 010: invalid function or declaration
admin.sma(338) : error 025: function heading differs from prototype

Compilation aborted.
26 Errors.
Done.


Kushfield 11-18-2018 06:55

Re: Admin base sql edited.
 
Those errors seem to suggest that you have made a typo somewhere in the code, possibly an extra (or missing) closing bracket somewhere. Double-check everything you last changed.

Kommendante 11-18-2018 07:02

Re: Admin base sql edited.
 
https://prnt.sc/ljt23e

Found it, thanks.

Instead of player name i am getting this weird domain name.
https://prnt.sc/ljt3gw

Kommendante 11-18-2018 07:21

Re: Admin base sql edited.
 
Mark it as solved, thank you Kushfield.


All times are GMT -4. The time now is 07:39.

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