Hi buttoz

Here's how I did it ...

function get_script($dbname) {
        $cmd = "/usr/bin/mysqldump -u"._DBUSER." -p"._DBPASS." "._MDFLAGS." ".$dbname;
        $script = `$cmd`;
        return $script;

_MDFLAGS is a constant which holds the flags you want to pass to mysqldump ... I 
commonly use -c and -add-drop-table.  _DBUSER and _DBPASS are also constants 
containing the username and password mysqldump needs to connect to mysql with (funnily 
enough!!).  Note there is NO space between the -p flag and the password.


t: 01903 739 997
w: www.thelittledot.com

The Little Dot is a partnership of
Ronan Chilvers and Giles Webberley

On 31 May,2003 at 12:51 buttoz buttoz wrote:

> hi,
> i want to backup mysql database.
> i use mysqldump command .
> when i use this command from server (win2000) , command promt its work fine.
> but when run this command (mysqldump) from php file, it creat backup file
> but
> with zero size.
> what can i do , help me?
> thanks,
>  zuhear

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

Reply via email to