Jump to content

sql problem -_-


Best-Killer

Recommended Posts


 

if ( tostring ( get ( "CONNECTION_TYPE" ) ):lower() == "mysql" ) then 
	outputConsole ( "Attempting to connect as MySQL... Please wait")
	db = dbConnect( "mysql", "dbname="..tostring(get("DATABASE_NAME"))..";host="..tostring(get("MYSQL_HOST"))..";port="..tostring(get("MYSQL_PORT"))..";unix_socket=/opt/lampp/var/mysql/mysql.sock", tostring(get("MYSQL_USER")), tostring(get("MYSQL_PASS")), "share=1;autoreconnect=1" );
elseif ( tostring ( get ( "CONNECTION_TYPE" ) ):lower() == "sqlite" ) then 
	db = dbConnect ( "sqlite", tostring(get("DATABASE_NAME")) .. ".sql" );
else 
	error ( tostring(get("CONNECTION_TYPE")) .. " is an invalid SQL connection -- valid: mysql, sqlite" );
end 

if not db then
	print ( "The database has failed to connect")
	return 
else
	print ( "Database has been connected")
end

function db_query ( ... ) 
	local data = { ... }
	return dbPoll ( dbQuery ( db, ... ), - 1 )
end

function db_exec ( ... )
	return dbExec ( db, ... );
end

dbexe failed, (1064) you have an error in your sql syntax; check the manual that corresponds to your mariaDB server version for the right syntax to use near

 

Link to comment

Okay, you didn't actually say much about the error. Screenshot the error you are getting because you just left out the most important part, the part after "near". Also you have an error in the dbExec but I see no dbExec commands, just the function for it. Send us that dbExec command you are getting the error from along with the full error message. 

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