13.01.2014, 21:10
(
Последний раз редактировалось Emmet_; 15.01.2014 в 03:02.
)
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:
An example with "mysql_parse":
Compatible versions
This is compatible with MySQL R7 and newer versions (thanks to iZN).
Download
Pastebin
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>
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");
}
This is compatible with MySQL R7 and newer versions (thanks to iZN).
Download
Pastebin