Jump to content

Recommended Posts

Witam, mam problem zpolaczeniem z baza mysql. Moj skrypt

  
  
local hostname = get( "hostname" ) or "SQL09.FREEMYSQL.NET" 
local username = get( "username" ) or "nazwa usera" 
local password = get( "password" ) or "haslo" 
local database = get( "database" ) or "nazwa bazy" 
local port = tonumber( get( "port" ) ) or 3306 
  
  
  
function connectToDatabase(res) 
    MySQLConnection = mysql_connect(hostname, username, password, database, port) 
     
    if (not MySQLConnection) then 
        if (res == getThisResource()) then 
            cancelEvent(true, "Cannot connect to the database.") 
        end 
        return nil 
    end 
     
    return nil 
end 
addEventHandler("onResourceStart", getResourceRootElement(getThisResource()), connectToDatabase, false) 
  
  
  

po uruchomieniu skrypt pokazuje blad

  
ERROR: \mysql\connect.lua:12: attempt to call global 'mysql_connect' (a nil value) 
  

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