LuaSQL PSP: Difference between revisions
From GameBrew
More actions
Created page with "{{Infobox PSP Homebrews |title=LuaSQL |image=psp02.png |description=A library to access SQL through PHP. |author=shaolan |lastupdated=2007/11/19 |type=Demos |format= |version=0.1 |license=Mixed |download=https://dlhb.gamebrew.org/psphomebrew/LuaSQLv0.1.rar |website=https://web.archive.org/web/20071202060125/http://xtreamlua.com/modules.php?name=Forums&file=viewtopic&t=2537 |source=https://dlhb.gamebrew.org/psphomebrew/LuaSQLv0.1.rar }} A library to access SQL through PHP..." |
No edit summary |
||
| Line 49: | Line 49: | ||
== External links == | == External links == | ||
* XtreamLua - [https://web.archive.org/web/20071202060125/http://xtreamlua.com/modules.php?name=Forums&file=viewtopic&t=2537 http://xtreamlua.com/modules.php?name=Forums&file=viewtopic&t=2537] (archived) | * XtreamLua - [https://web.archive.org/web/20071202060125/http://xtreamlua.com/modules.php?name=Forums&file=viewtopic&t=2537 http://xtreamlua.com/modules.php?name=Forums&file=viewtopic&t=2537] (archived) | ||
[[Category:Lua applications on PSP]] | |||
Latest revision as of 11:48, 2 January 2025
| 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)