Jump to content

MYSQL problem


Gtakiki

Recommended Posts

Hi all help me PLS

local host = "" -- mysql host url 
local username = "" -- your sql login username 
local password = "" -- your sql login password 
local database = "" -- yoru sql database name 
  
-- To Connect to main database, use --  
-- exports['MySQL']:connectMain(source) 
------      Nothing Below Here Needs To Be Edited.      ----- 
function getHost() 
    return host 
end 
  
function getUser() 
    return username 
end 
  
function getPass() 
    return password 
end 
  
function getDatabase() 
    return database 
end 
  
function connectMain() 
    return dbConnect("mysql", "dbname="..database..";host="..host, username, password, "autoreconnect=1") 
end 
  
function customConnect(cdata,chost,cuser,cpass) 
    return dbConnect("mysql", "dbname="..cdata..";host="..chost, cuser, cpass, 'autoreconnect=1') 
end 

Link to comment

Here:

local host = "" -- mysql host url 
local username = "" -- your sql login username 
local password = "" -- your sql login password 
local database = "" -- yoru sql database name 
  
-- To Connect to main database, use -- 
-- exports['MySQL']:connectMain(source) 
------      Nothing Below Here Needs To Be Edited.      ----- 
function getHost() 
    return host 
end 
  
function getUser() 
    return username 
end 
  
function getPass() 
    return password 
end 
  
function getDatabase() 
    return database 
end 
  
function connectMain() 
    return dbConnect("mysql", "dbname="..database..";host="..host, username, password, "autoreconnect=1") 
end 
  
function customConnect(cdata,chost,cuser,cpass) 
    return dbConnect("mysql", "dbname="..cdata..";host="..chost, cuser, cpass, 'autoreconnect=1') 
end 

Please read here next time: https://forum.multitheftauto.com/viewto ... b05aa262f3

Anyways, What do you need help with?

Edited by Guest
Link to comment
local host = "" -- mysql host url 
local username = "" -- your sql login username 
local password = "" -- your sql login password 
local database = "" -- yoru sql database name 
  
-- To Connect to main database, use -- 
-- exports['MySQL']:connectMain(source) 
------      Nothing Below Here Needs To Be Edited.      ----- 
function getHost() 
    return host 
end 
  
function getUser() 
    return username 
end 
  
function getPass() 
    return password 
end 
  
function getDatabase() 
    return database 
end 
  
function connectMain() 
    return dbConnect("mysql", "dbname="..database..";host="..host, username, password, "autoreconnect=1") 
end 
  
function customConnect(cdata,chost,cuser,cpass) 
    return dbConnect("mysql", "dbname="..cdata..";host="..chost, cuser, cpass, 'autoreconnect=1') 
end 

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