 |
 |
 |
 |
| Author |
Message |
CrazyMan
Joined: 05 Apr 2006 Posts: 54
|
Posted: Sat May 27, 2006 4:44 pm Post subject: simple MySQL support |
|
|
Now i see Sphere emu changelog:
| Code: | 07-02-05, Vjaka
- Added simple mySQL support. New settings MySqlHost, MySqlUser, MySqlPassword,
MySqlDatabase will be used to connect to the DB in case if MYSQL is set to 1.
You will need extra .dll/.so to download for sphere installation. They will
join the packages.
30-07-05, Vjaka
- Added: MySQL support to scripts. You can execute any queries and statements,
as well as get data from mysql link. A special script object similar to the
FILE or OBJ added and is named DB.
DB Properties:
CONNECTED - the current state of database connection (1 or 0)
ROW.NUMROWS - number of rows returned by last query
ROW.NUMCOLS - number of columns returned by last query
ROW.* - list of all columns returned by last query. Both column names and
numbers are saved in the list, so you can use indexes [0..] or column
names [id, name, etc] here.
DB Methods:
CLOSE - disconnects the SQL server
CONNECT - connects to the database (using mysql settings in sphere.ini)
EXECUTE - executes SQL query not filling any results anywhere
QUERY - executes SQL query filling ROW.* properties information
Example of a simple query:
DB.query "SELECT id FROM users WHERE account='<SRC.ACCOUNT.NAME>'"
SERV.log "Got ID = <DB.ROW.id>"
Note: Server does not create connection upon start, so if you wish to make
the connection with the server start, add DB.connect to the function
f_onserver_start.
|
Shinigami, its hard to code or you don`t see "for what it is"
(Sorry - bad English) |
|
 |
|
|
 |
 |
|
 |
 |
|
 |
 |
|