/* create a new database */ /* mysql database names */ #define DBNAME "bs_gseen" #define DBSCHEMA "CREATE TABLE " DBNAME " (\ nick VARCHAR(32) NOT NULL, PRIMARY KEY (nick),\ type INT,\ host TEXT,\ vhost TEXT,\ chan VARCHAR(32),\ msg TEXT,\ last BIGINT(14),\ spent INT,\ newnick VARCHAR(32))\ TYPE=myISAM " static MYSQL *mymysql; static MYSQL_RES *myres; /* dont forget to mysql_free_result() ! */ static MYSQL_ROW myrow; char *myresult; char *qbuf1, *qbuf2, *qbuf3; /* the qbuf variables contain escaped strings for mysql queries */ /* dont forget to free() them after use! */ int mydb_init(void); int do_query(const char *fmt, ...); char *quote(char *arg); int purgedb(int argc, char *argv[]);