Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.
Revision as of 11:06, 2 January 2025 by HydeWing (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
LuaSQL
General
Authorshaolan
TypeDemos
Version0.1
LicenseMixed
Last Updated2007/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

Advertising: