Jump to content

Database - to GUI


Eistee

Recommended Posts

I connected it so:

local mysqlhost1 = "localhost" 
local mysqluser1 = "viomax" 
local mysqlpassword1 = "viomax" 
local mysqldatabase1 = "viomax" 
  
  
local mysqlhost2 = "localhost" 
local mysqluser2 = "viomax" 
local mysqlpassword2 = "viomax" 
local mysqldatabase2 = "viomax" 
  
addEventHandler("onResourceStart", getResourceRootElement(), function() 
    handler = dbConnect("mysql", "dbname="..mysqldatabase1..";host="..mysqlhost1, mysqluser1, mysqlpassword1, "autoreconnect=1") 
  
  
    if not(handler) then     
        outputServerLog("MySQL funktioniert nicht, versuche zweite Datenbank. Bitte warten...")  
        handler = dbConnect("mysql", "dbname="..mysqldatabase2..";host="..mysqlhost2, mysqluser2, mysqlpassword2, "autoreconnect=1") 
        if not(handler) then 
            outputServerLog("Zweite Datenbank funktioniert nicht, beende...") 
            cancelEvent() 
        else 
            outputServerLog("Zweite Datenbank akzeptiert!") 
            housesys_startup() 
        end 
    else 
        outputServerLog("Erste Datenbank akzeptiert!") 
        housesys_startup() 
    end 
end) 
  

In the database it looks so:

The table: g2rpc.png

And thats in the table: VUWEf.png

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