Jump to content

Error In Mysql


WeCan

Recommended Posts

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
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...