Skip to content

Instantly share code, notes, and snippets.

View Shnoulle's full-sized avatar
🏠
Working from home

Denis Chenu Shnoulle

🏠
Working from home
View GitHub Profile
@Shnoulle
Shnoulle / sql_import_class.php
Created May 11, 2023 09:12 — forked from nmcgann/sql_import_class.php
PHP SQL Import Class to read an SQL dump file and run it as SQL statements over a PDO connection
<?php
/**
* Sql_import class.
*
* Reads a SQL file (e.g. a dump from phpmyadmin) and executes it programmatically.
*
* Handles procedures, triggers etc. and can load large dumps. Great for
* installer scripts to load up a db schema and populate with initial data.
*
* Came from: http://stackoverflow.com/questions/147821/loading-sql-files-from-within-php