[Include] Database dump parser
#1

Database dump parser

Introduction
This is just a simple include which parses database dumps (.sql files) into a MySQL database. It will search the file for any tables, and create those, aswell as any corresponding table data, and extra queries.

What's the point?
The point is that it can save you a load of time. You can parse queries easily without having to log into phpMyAdmin all of the time, and could be useful for some server owners (like me).

Installation
Simply download "sql-parser.inc" and add it to the top of your script:

pawn Код:
#include <sql-parser>
An example with "mysql_parse":

pawn Код:
new
    handle = mysql_connect("127.0.0.1", "root", "my_database", "");

if (fexist("db_dump.sql"))
{
    mysql_parse("db_dump.sql", handle);
    fremove("db_dump.sql");
}
Compatible versions
This is compatible with MySQL R7 and newer versions (thanks to iZN).

Download
Pastebin
Reply
#2

Good idea there.
Reply
#3

Improving the query mechanism, sweet!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)