Karuzo Posted February 1, 2014 Share Posted February 1, 2014 Hey Guys. So i have a little problem, i want to connect my wbb forum with my server. Code : exports.woltlab:woltlab_connect ( "*****", "****", "****", "****" ) function CheckUsernameS() local login = exports.woltlab:woltlab_userExists (triggerClientEvent("SendUsername, client")) if login == true then exports.woltlab:woltlab_checkPassword(login, triggerClientEvent(SendPassword)) outputChatBox("Name is right") else outputChatBox("Name is wrong.") end end Link to comment
Castillo Posted February 1, 2014 Share Posted February 1, 2014 "woltlab" is a resource? Link to comment
Karuzo Posted February 1, 2014 Author Share Posted February 1, 2014 Ye the resource just says it can't connect to the database. But the dbName, dbHost ,etc.. are all correct. Link to comment
MTA Team 0xCiBeR Posted February 1, 2014 MTA Team Share Posted February 1, 2014 Don't know why you are triggering a client event. This is the example from the wiki: exports.woltlab:woltlab_connect ( "127.0.0.1", "root", "", "wcf" ) local login = exports.woltlab:woltlab_checkPassword ( "xthepr0mise", "test" ) if login == true then outputChatBox("Your password is right!") else outputChatBox("Your password is wrong!") end exports.woltlab:woltlab_disconnect() Remeber: It uses the MySQL-Plugin to connect to the database Link to comment
Karuzo Posted February 1, 2014 Author Share Posted February 1, 2014 Yea i know . I have a Login Panel with 2 edit boxes. a username edit box and a password edit box. I get the content of the edit boxes with guiGetText , and trigger them to the Server-Side. That's why i'm triggering. Hope you could understand me Link to comment
MTA Team 0xCiBeR Posted February 1, 2014 MTA Team Share Posted February 1, 2014 Should be the other way, client-server not server-client. Remember you have to have that plugin also. Link to comment
Karuzo Posted February 1, 2014 Author Share Posted February 1, 2014 I'm running the resource. What do you mean by client-server ? I'm getting the Name clientsided and sending it to the server. Link to comment
MTA Team 0xCiBeR Posted February 1, 2014 MTA Team Share Posted February 1, 2014 Are you running the plugin? Link to comment
xXMADEXx Posted February 1, 2014 Share Posted February 1, 2014 Chances are your dbConnect might be setup wrong.. This is what I use to connect my database: local dbData = { db = "db_name", host="localhost", port=3306, user="root", pass="" } db = dbConnect( "mysql", "dbname="..dbData.db..";host="..dbData.host..";port="..dbData.port, dbData.user, dbData.pass, "share=1;autoreconnect=1;" ); Link to comment
Karuzo Posted February 1, 2014 Author Share Posted February 1, 2014 This is the exported connect function : function woltlab_connect ( dbHost, dbUsername, dbPasswort, dbName ) executer = mysql_connect ( dbHost, dbUsername, dbPasswort, dbName ) if not executer then outputDebugString ( "Fehler[100]: Konnte keine Verbindung zur Datenbank aufbauen!" ) fileAppend ( "c", getLogTime(), "Fehler[100]: Konnte keine Verbindung zur Datenbank aufbauen!" ) return false else fileAppend ( "d", getLogTime()," Mit Datenbank verbunden!" ) return true end end Link to comment
MTA Team 0xCiBeR Posted February 1, 2014 MTA Team Share Posted February 1, 2014 Is your database running on a diferent server than the server?... If it's so, you have to allow external connections Link to comment
Karuzo Posted February 1, 2014 Author Share Posted February 1, 2014 Oh yea didn't think about that. How do i allow them ? Link to comment
MTA Team 0xCiBeR Posted February 1, 2014 MTA Team Share Posted February 1, 2014 Check this out: http://stackoverflow.com/questions/8380797/enable-remote-mysql-connection If that doesn't work, google is your best friend mate. Link to comment
Karuzo Posted February 1, 2014 Author Share Posted February 1, 2014 Hmm, well i have a webspace from cwcity.de and that doesn't really help me ._. Someone? 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