2
Contributors
5
Replies
6
Views
9 Years
Discussion Span
Last Post by jencinas69
0

looks like there is an error in the restore section of the example, I'm sure that

$query      = "LOAD DATA INFILE 'backupFile' INTO TABLE $tableName";

is suppose to be

$query      = "LOAD DATA INFILE '$backupFile' INTO TABLE $tableName";
0

what about the icluded files

<?php
include 'config.php';
include 'opendb.php';

$backupFile = $dbname . date("Y-m-d-H-i-s") . '.gz';
$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile";
system($command);
include 'closedb.php';
?>
0

All those are is connection and configs like this:
config.php

$host = "localhost";
$username = "dbusername";
$password = "dbpassword";
$dbname = "database name";

opendb.php

$link = mysql_connect($host, $username, $password) or die(mysql_error());
mysql_select_db ($dbname, $link) or die(mysql_error());

closedb.php

mysql_close($link);

if you are going to use the system($command); option, I don't think you actually need to create a database connection, I don't know, maybe you do.

0

I think this is to get all the DB what about to get certain information from one tabel?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.