[SOLVED] Connect to a mysql database online
Posted: Mon Apr 08, 2013 4:33 pm
Hi everyone !
I am doing a project for school, the main purpose of the project is to create a game and save scores on an online database so we can access it throught our website.
We have the game, website and mysql database, the problem is that I have no clue how to connect to my database from love. I found this topic : viewtopic.php?f=4&t=11891&p=71350&hilit=mysql#p71350.
From what I understood I need sth like a mysql.dll . I found one on internet but to be honest I doubt it is something really official... anyway, I just would like to know which files I need before starting to code (any .dll or other), and inside my code how can I start the connection ?
I found something like :
Is it correct ?
Thank you for your help .
I am doing a project for school, the main purpose of the project is to create a game and save scores on an online database so we can access it throught our website.
We have the game, website and mysql database, the problem is that I have no clue how to connect to my database from love. I found this topic : viewtopic.php?f=4&t=11891&p=71350&hilit=mysql#p71350.
From what I understood I need sth like a mysql.dll . I found one on internet but to be honest I doubt it is something really official... anyway, I just would like to know which files I need before starting to code (any .dll or other), and inside my code how can I start the connection ?
I found something like :
Code: Select all
-- load the MySQL dll
loadlib ("mysql.dll", "luaopen_luasqlmysql") ()
-- create environment object
env = assert (luasql.mysql())
-- connect to data source
con = assert (env:connect ("databasename", "username", "password", "servername"))
Thank you for your help .