First of I searched all around and could not find a valid answer.
I want to import database files into a database using PHP.
The following only works if the import.php file resides in the same folder (temp) as the database files:
$command = "gunzip --to-stdout $backupfile | mysql -u$database_user -p$database_pass $database";
If I place the import.php in another location and add a path to the $backupfile, it does not work as shown below:
$database_path = '/home/site/public_html/temp/';
$command = "gunzip --to-stdout $database_path.$backupfile | mysql -u$database_user -p$database_pass $database";
What is the correct way to add the path to the database file ($backupfile) so that I can run the PHP script from any location?
Thanks in advance.