Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function onResourceStartMysqlConnection()
- local xml = xmlLoadFile("./xml/config.xml")
- if not xml then
- outputServerLog("Konnte config.xml nicht finden. Laden abgebrochen!")
- cancelEvent()
- stopResource(getThisResource())
- return false
- end
- --MySQL Daten
- local mysqlchild = xmlFindChild(xml, "mysqldata", 0)
- if not mysqlchild then
- outputServerLog("Keine MySQL Verbindungsdaten gefunden.")
- end
- local mysqlhost = xmlGetVal(mysqlchild, "ms1574.nitrado.net")
- if mysqlhost then mysql_host = mysqlhost end
- local mysqluser = xmlGetVal(mysqlchild, "ni105757_1_DB")
- if mysqluser then mysql_user = mysqluser end
- local mysqlpsw = xmlGetVal(mysqlchild, "8e70D9gh")
- if mysqlpsw then mysql_password = mysqlpsw end
- local mysqltable = xmlGetVal(mysqlchild, "ni105757_1_DB")
- if mysqltable then mysql_table = mysqltable end
- g_mysql["connection"] = mysql_connect(mysql_host, mysql_user, mysql_password, mysql_table, 3306, nil, "")
- if not g_mysql["connection"] then
- outputServerLog("Kann die MySQL-Verbindung nicht aufbauen!")
- print("Kann die MySQL-Verbindung nicht aufbauen!")
- stopResource(getThisResource())
- eventcancled = 1
- cancelEvent()
- return false
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement