Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias details { return }
- on *:INPUT:*: {
- if (!%database) { %database = mirc }
- if ($regex(sql,$1,/(/|/{2})/)) { return }
- if ($1 == ~createtable) && ($2) {
- var %info_db = $mysql_connect($readini(db.info.ini, info, host), $readini(db.info.ini, info, user), $readini(db.info.ini, info, pass))
- if (%info_db) {
- var %sql = CREATE TABLE $2-
- var %stmt = $mysql_exec(%info.db, %sql)
- if (!%stmt) {
- echo -a $str($chr(160),25) $+(7Error Message:12 %mysql_errstr,$chr(32),07,$chr(40),$chr(32),09Error:,$chr(32),%mysql_errno,$chr(32),07,$chr(41))
- }
- else {
- mysql_exec %info.db %stmt
- }
- }
- }
- if ($1 == ~insert) && ($2) {
- %insertdata = $3-
- var %x = 1
- %testvar = $numtok(%insertdata,32)
- while (%x <= %testvar) {
- set %testvar_result $instok(%testvar_result,$mysql_qt($gettok(%insertdata,%x,32)),0,44)
- inc %x
- }
- var %info.db = $mysql_connect($readini(db.info.ini, info, host), $readini(db.info.ini, info, user), $readini(db.info.ini, info, pass), $readini(db.info.ini, info, db))
- if (%info.db) {
- %sql = INSERT INTO $2 VALUES ( %testvar_result );
- var %stmt = $mysql_exec(%info.db, %sql)
- unset %testvar* %insertdata
- if (!%stmt) {
- echo -a $str($chr(160),25) $+(7Error Message:12 %mysql_errstr,$chr(32),07,$chr(40),$chr(32),09Error:,$chr(32),%mysql_errno,$chr(32),07,$chr(41))
- }
- else {
- mysql_exec %info.db %stmt
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement