Raised This Month: $51 Target: $400
 12% 

Solved Admin base sql edited.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Kommendante
Junior Member
Join Date: Nov 2016
Old 11-17-2018 , 07:00   Admin base sql edited.
Reply With Quote #1

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?

Last edited by Kommendante; 11-18-2018 at 07:22.
Kommendante is offline
Kushfield
Member
Join Date: Jan 2017
Location: Estonia
Old 11-17-2018 , 12:42   Re: Admin base sql edited.
Reply With Quote #2

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.
Kushfield is offline
Kommendante
Junior Member
Join Date: Nov 2016
Old 11-18-2018 , 04:45   Re: Admin base sql edited.
Reply With Quote #3

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?

Last edited by Kommendante; 11-18-2018 at 05:19. Reason: image add
Kommendante is offline
Kushfield
Member
Join Date: Jan 2017
Location: Estonia
Old 11-18-2018 , 05:56   Re: Admin base sql edited.
Reply With Quote #4

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
Kushfield is offline
Kommendante
Junior Member
Join Date: Nov 2016
Old 11-18-2018 , 06:27   Re: Admin base sql edited.
Reply With Quote #5

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.
Kommendante is offline
Kushfield
Member
Join Date: Jan 2017
Location: Estonia
Old 11-18-2018 , 06:55   Re: Admin base sql edited.
Reply With Quote #6

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.

Last edited by Kushfield; 11-18-2018 at 06:57.
Kushfield is offline
Kommendante
Junior Member
Join Date: Nov 2016
Old 11-18-2018 , 07:02   Re: Admin base sql edited.
Reply With Quote #7

https://prnt.sc/ljt23e

Found it, thanks.

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

Last edited by Kommendante; 11-18-2018 at 07:07.
Kommendante is offline
Kommendante
Junior Member
Join Date: Nov 2016
Old 11-18-2018 , 07:21   Re: Admin base sql edited.
Reply With Quote #8

Mark it as solved, thank you Kushfield.
Kommendante is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:33.


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