Re: MySQL Backup, final script !!!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



thanks a lot for your response but i got

Fatal error: Call to a member function on a non-object in
c:\inetpub\wwwroot\dump.php on line 3
not that mysql is 3.23.53

my script is :
/////
<?php
$sql = 'SHOW TABLES FROM chat';
$db->query($sql);
while ($row  = $db -> fetchRow ('DB_GETMODE_NUM') )
{
$sql = ' BACKUP TABLE '.$row[0].' TO "/db_backup" ';
$db->query($sql);
}
?>
/////




"Armand Turpel" <armand@a-tu.net> wrote in message
3EFAE3FA.6070400@a-tu.net">news:3EFAE3FA.6070400@a-tu.net...
> Hi,
>
> You have only to modify it to your environement
> It works with mysql >= 3.23.52
>
>  // Get all table names of the database
>     //
>     $sql = '
>         SHOW TABLES
>         FROM
>            test_db
>     ;
>     $db->query($sql);
>
>
>     while($row  = $db->fetchRow( 'DB_GETMODE_NUM'))
>     {
>
>             $sql = '
>                 BACKUP TABLE
>                     '.$row[0].'
>                 TO
>                     "/db_backup"
>             ';
>             $db->query($sql);
>     }
>
> Armand
>
>
>
> Nabil wrote:
>
> >I have been searching inside the mailing lists regarding the a PHP code
that
> >dump all or a selected databases from MySQL ...
> >and haven't managed to get a script like PhpMyAdmin does... please any
ready
> >script or idea ...
> >
> ><?php exec("mysqldump -u root -ppassword -A > backup.sql"); ?>
> >//Because it didn't work with me (on windows by example).
> >
> >All what I am thinking to do is a script that retrieved the database
names
> >then retrieve the tables names, then fields names and dump the data in an
> >schema like mysqldump does....
> >
> >any suggestions??
> >
> >Cheers...
> >Nabil
> >
> >
> >
> >
> >
>
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux