papam77 Posted July 19, 2013 Share Posted July 19, 2013 function db () db = dbConnect( "sqlite", "dbname=zahrej;host=mysql.mmhost.eu", "zahrej", "passwordhhaha", "share=1" ) if ( db ) then outputChatBox ( "Connected" ) else outputChatBox ( "Something went wrong" ) end end addCommandHandler ("database", db ) Why it doesn't show me in chat if is work? Link to comment
Jaysds1 Posted July 19, 2013 Share Posted July 19, 2013 One thing you would have to avoid is using the same function name as the variable name. Make sure this is server-sided. Try this: function dbFunc() local db = dbConnect( "sqlite", "dbname=zahrej;host=mysql.mmhost.eu", "zahrej", "passwordhhaha", "share=1" ) if ( db ) then outputChatBox ( "Connected" ) else outputChatBox ( "Something went wrong" ) end end addCommandHandler ("database", dbFunc ) 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