Best-Killer Posted November 1, 2016 Share Posted November 1, 2016 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
Gravestone Posted November 1, 2016 Share Posted November 1, 2016 Which connection type are you using? Link to comment
KariiiM Posted November 1, 2016 Share Posted November 1, 2016 2 hours ago, Best-Killer said: Xampp Xampp isn't a connection, Im sure you mean Mysql. Link to comment
KariiiM Posted November 1, 2016 Share Posted November 1, 2016 The error says its a sql syntax problem... so, the code that you shared here has nothing to do with the sql syntax, its just a code for database connection sharing. Link to comment
Best-Killer Posted November 1, 2016 Author Share Posted November 1, 2016 so , where the proble m ?? in sql or in NGsql (i'm using nerd gaming scripts & editing them , making new scripts to them ) Link to comment
KariiiM Posted November 1, 2016 Share Posted November 1, 2016 You had removed the first part of the error message to tell you where does this error exist at. Link to comment
pa3ck Posted November 1, 2016 Share Posted November 1, 2016 What operating system is it running on? Are you sure you are using XAMPP? If so, that's for Windows, but the unix socket you are using is related to Linux and that is LAMP. Link to comment
Best-Killer Posted November 1, 2016 Author Share Posted November 1, 2016 karrim the first part is ngql pa3ck i'm sure using xampp Link to comment
pa3ck Posted November 1, 2016 Share Posted November 1, 2016 Okay, then get rid of the "unix_socket = ..." thing, because that's for Linux and most of the times you don't need to specify that at all anyway. Link to comment
Best-Killer Posted November 1, 2016 Author Share Posted November 1, 2016 i removed it but still same eroor Link to comment
pa3ck Posted November 1, 2016 Share Posted November 1, 2016 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
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