More actions
LuaSQL | |
---|---|
![]() | |
General | |
Author | shaolan |
Type | Demos |
Version | 0.1 |
License | Mixed |
Last Updated | 2007/11/19 |
Links | |
Download | |
Website | |
Source | |
A library to access SQL through PHP.
User guide
You will need a server that supports PHP and SQL databases.
In the archive, you will find a "PHP" folder. Place its contents at the root of your server (typically where your "index.php" file is located).
You should have: your_server/LUA/SQLRequest.php
PSP Side:
--// Calling the library dofile("SQLRequest.lua") --// Initializing the connection SQL.init(server, database, login, password) --// Connecting to the database SQL.connect()
--// SELECT query variable = SQL.select(table, field, parameter) --// UPDATE query SQL.update(table, field, value, parameter)
--// Closing the SQL connection SQL.close()
Notes:
- When performing the UPDATE query, if it succeeds, the variable SQL.error will be false; if there’s an error, it will be true.
- The library uses the first available Wi-Fi connection by default and works with LUA PLAYER 0.16.
- In the parameters, you can include as many as you want, but spaces should be replaced with %20, and avoid using single or double quotes for now.
External links
- XtreamLua - http://xtreamlua.com/modules.php?name=Forums&file=viewtopic&t=2537 (archived)