mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-28 00:24:21 +02:00
create new method for populating database
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
include( "config.php" );
|
||||
|
||||
$sql_file = 'build.sql';
|
||||
$sql_fh = fopen( $sql_file, 'r' );
|
||||
$connection = mysql_connect( $config['db_host'], $config['db_user'], $config['db_pass'] );
|
||||
mysql_select_db( $config['db_name'] );
|
||||
|
||||
while( !feof( $sql_fh ) ) {
|
||||
$line = fgetss( $sql_fh );
|
||||
$creation = mysql_query( $line );
|
||||
if( !$creation ) {
|
||||
echo( mysql_error() . "\n" );
|
||||
}
|
||||
}
|
||||
|
||||
fclose($sql_fh);
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user