Any way to connect a MySQL Server to the program?
A module or something?
mysql.connect(host, user, pass, database, port) and
mysql.query(query)
Anything like that?
Thanks
MySQL?
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: MySQL?
You could use luaSQL.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: MySQL?
Though you would have to add it in to your own copy of the LOVE source files, and then compile your own version. That is, if you wanted to use it with LOVE.nevon wrote:You could use luaSQL.
Re: MySQL?
Lua can load modules dynamically. So if lua can load a module, then love could do it also. You just need to put your (binary or lua) module within package.cpath/package.path respectively. If you want to distribute your game, then you would need to distribute those libraries as well (and for every platform you intend to support).BlackBulletIV wrote:Though you would have to add it in to your own copy of the LOVE source files, and then compile your own version. That is, if you wanted to use it with LOVE.nevon wrote:You could use luaSQL.
But then it would be better to statically compile your own love2d indeed.
BTW, I wish love2d had sqlite compiled in...
My lovely code lives at GitHub: http://github.com/miko/Love2d-samples
- ishkabible
- Party member
- Posts: 241
- Joined: Sat Oct 23, 2010 7:34 pm
- Location: Kansas USA
Re: MySQL?
yep, it works quite well in fact. i used a profiler library with it too.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: MySQL?
Oh, well that's cool then.miko wrote:Lua can load modules dynamically. So if lua can load a module, then love could do it also. You just need to put your (binary or lua) module within package.cpath/package.path respectively. If you want to distribute your game, then you would need to distribute those libraries as well (and for every platform you intend to support).BlackBulletIV wrote:Though you would have to add it in to your own copy of the LOVE source files, and then compile your own version. That is, if you wanted to use it with LOVE.nevon wrote:You could use luaSQL.
- kikito
- Inner party member
- Posts: 3153
- Joined: Sat Oct 03, 2009 5:22 pm
- Location: Madrid, Spain
- Contact:
Re: MySQL?
I'd try using simple Lua files before attempting to use databases. Lua is flexible enough to express both game logic and game data cleanly.
When I write def I mean function.
- Taehl
- Dreaming in associative arrays
- Posts: 1025
- Joined: Mon Jan 11, 2010 5:07 am
- Location: CA, USA
- Contact:
Re: MySQL?
I agree with kikito. Why do you need to use SQL databases? Unless it's something REALLY advanced, you should have no problem expressing your data with Lua tables (they really are amazing, I assure you).
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
- BlackBulletIV
- Inner party member
- Posts: 1261
- Joined: Wed Dec 29, 2010 8:19 pm
- Location: Queensland, Australia
- Contact:
Re: MySQL?
I agree. You can store data using Lua table syntax in text files, and bring them back into data by using love.filesystem.read and then loadstring. You could also use loadfile or dofile, but this doesn't work in SELOVE.Taehl wrote:I agree with kikito. Why do you need to use SQL databases? Unless it's something REALLY advanced, you should have no problem expressing your data with Lua tables (they really are amazing, I assure you).
Re: MySQL?
despite the 'keep it simple' attitude thats forming in the comments here, I still think its a great idea to have SQL available to use; Mind you, I use JSON to save my tables and such
My Development Diary - http://shanegadsby.info
Who is online
Users browsing this forum: Bing [Bot] and 9 guests