Rich (BB code):
/sqlconnect [ini <iniApp>] [<user> <password> <database>] [host <host address> <user> <password> <database>]
/sqlcreate <db name|table name [field1 field2 ...]>
/sqldelete <db|table> name
/sql <select [table_reference tbl_name [WHERE where_definition]]|saveset [set_name table_reference tbl_name [WHERE where_definition]]|deleteset [set_name],addfield [field1, (field1 field2), ...]|delete [tbl_name (field=name, field>#)]|update [tbl_name field1=oldValue field1=newValue]|insert[field=value, (field=value field2=value2), ...]|usedb [database]|changeuser [user] [password]>
/sqllist <db|table|field tbl_name>
/sqlquery QUERY;
$sqlresult(set_name,column,row)
Simple little macro i wrote to test it over and over... yes it works very well and maybe someone can write a good macro for it... i know this one is sloppy... but after 4 months of working with sql... give me a break...
**These are just examples... this plugin should be able to do almost anything you want...
Rich (BB code):
Sub Main
/Call DoSQLCONNECT
/Call DoSQLCREATE
/Call DoSQLINSERT
/Call DoSQLLIST
/call CheckQuery
/call DoSQLREMOVE
/call DoSQLDELETE
/return
Sub DoSQLCONNECT
/sqlconnect host 127.0.0.1 USERNAME PASSWORD DBNAME
/return
Sub DoSQLCREATE
/sqlcreate db Zaped
/sql usedb Zaped
/sqlcreate table Zones ZoneID Safe
/return
Sub DoSQLINSERT
/sql insert Zones ZoneID='${Zone.ID}' Safe='TRUE'
/return
Sub DoSQLLIST
/sqllist table
/return
Sub CheckQuery
/sqlquery query ZoneCheck SELECT Safe FROM Zones WHERE ZoneID='${Zone.ID}'
/if (${sqlresult[ZoneCheck 0 0]}) {
/echo Its safe to play here! go ahead!!!
/return
}
/if (${sqlresult[ZoneCheck 0 0].Equal[FALSE]}) {
/echo Its Unsafe to play here... run away!!!
/return
}
/echo Nope nothing found... find a new zone to play in..
/return
Sub DoSQLREMOVE
/sql delete Zones ZonesID='${Zone.ID}'
/return
Sub DoSQLDELETE
/sqldelete table Zones
/sqldelete db Zaped
/return
Will work on it more... i tested it pretty theroly so shouldn't crash...
View attachment MQ2SQL.dll


