Jump to content

prblem with geting back up from db


hno

Recommended Posts

HI

I have written this script to geting back up from data base and save it in a file :

 

ob_start();

$db=mysqli_connect("localhost","root","","php");

$tableName  = 'user';

$backupFile = 'b/user.sql';

$query= "SELECT * INTO OUTFILE '$backupFile' FROM $tableName";

$result = mysql_query($query);

echo mysqli_connect_error() ;

if ($result) echo "success";

 

it is not working

 

what is the problem ?

 

thanks

Link to comment
https://forums.phpfreaks.com/topic/191941-prblem-with-geting-back-up-from-db/
Share on other sites

Well the main problem I can see is you've not provided us with enough details to help. In what way does it not work, what appears on screen? Does it say success but the file isn't there? Is the file there but empty? Does the screen not say success but has an error message? If so what? Is the screen blank and there's no file?

 

Help us, help you.

db backups are a lot easier from the command line ( using mysqldump )

 

mysqldump -h host -u user -p passwd db > backup.sql

 

thanks for your reply ,but it runs on command line . I want to make a script that runs by cron job every day and make a backup from database automatically

 

 

Well the main problem I can see is you've not provided us with enough details to help. In what way does it not work, what appears on screen? Does it say success but the file isn't there? Is the file there but empty? Does the screen not say success but has an error message? If so what? Is the screen blank and there's no file?

 

Help us, help you.

 

sorry, it is not say "success" and its not make anything . there is not error message

 

thanks for your reply

Well the main problem I can see is you've not provided us with enough details to help. In what way does it not work, what appears on screen? Does it say success but the file isn't there? Is the file there but empty? Does the screen not say success but has an error message? If so what? Is the screen blank and there's no file?

 

Help us, help you.

 

 

sorry, it is not say "success" and its not make anything . there is not error message

 

thanks for your reply

 

please help me , it's very important . have you ran a back up script ? please give me some examples

 

thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.