WeCan Posted October 1, 2018 Share Posted October 1, 2018 Hi i have Error in my script can you Help me ? i think i should make column for my Database Game mode ! This is my error in Server Log ! INFO: MYSQL ERROR 1146: Table 'mta.elections' doesn't exist Link to comment
Dimos7 Posted October 1, 2018 Share Posted October 1, 2018 Yes that mean that table is not exist you need make it and put clomn on it Link to comment
LyricalMM Posted October 2, 2018 Share Posted October 2, 2018 look in the server-side script on the line where it says "INSERT" and there you have the table name and the columns Link to comment
sanyisasha Posted October 3, 2018 Share Posted October 3, 2018 I love this help requests Man, the error message show you exactly what's the problem: you don't have a table with name elections. Just upload the stolen/downloaded .sql file into phpmyadmin/mta/export and it will work. Link to comment
VenomOG Posted October 5, 2018 Share Posted October 5, 2018 addEventHandler ( "onResourceStart", resourceRoot, function ( resource ) handler = dbConnect ( "sqlite", "database.db" ) if ( handler ) then outputDebugString ( getResourceName ( resource ) ..": Successfully connected to SQLite database." ) dbExec ( handler, "CREATE TABLE IF NOT EXISTS 'elections' ( id INTEGER PRIMARY KEY, votername TEXT, elected TEXT )" ) else outputDebugString ( getResourceName ( resource ) ..": Connection to SQLite database failed.", 1 ) cancelEvent ( ) end end ) @WeCan Link to comment
WeCan Posted October 5, 2018 Author Share Posted October 5, 2018 2 hours ago, Knuck said: addEventHandler ( "onResourceStart", resourceRoot, function ( resource ) handler = dbConnect ( "sqlite", "database.db" ) if ( handler ) then outputDebugString ( getResourceName ( resource ) ..": Successfully connected to SQLite database." ) dbExec ( handler, "CREATE TABLE IF NOT EXISTS 'elections' ( id INTEGER PRIMARY KEY, votername TEXT, elected TEXT )" ) else outputDebugString ( getResourceName ( resource ) ..": Connection to SQLite database failed.", 1 ) cancelEvent ( ) end end ) @WeCan Thank you On 04/10/2018 at 02:19, sanyisasha said: I love this help requests Man, the error message show you exactly what's the problem: you don't have a table with name elections. Just upload the stolen/downloaded .sql file into phpmyadmin/mta/export and it will work. Be polite , You don't have to Answer Link to comment
sanyisasha Posted October 6, 2018 Share Posted October 6, 2018 On 05/10/2018 at 12:08, WeCan said: Thank you Be polite , You don't have to Answer I know, but your problem is you don't know what is mysql, don't know how to use. Then where you get this error? From a downloaded script? Yeah, sure. Btw the "solution" is just make the error gone, but it's not solution for the problem: you have to create a table in database before you can use it. And create it in the mysql connection script is bad, because next time you want to make a script what use database, you'll get this error again, and you'll do the wrong solution... again. And so on. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now