Sorry if this is inappropriate post.
TIA,
Shane
that should work.
myke
TIA,
Shane
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general...@lists.php.net
For additional commands, e-mail: php-gene...@lists.php.net
To contact the list administrators, e-mail: php-lis...@lists.php.net
http://www.ov-m.com/mysqlphpbak/
You will need to know the correct paths to set up the .ini file, but after
that it is SMOOTH sailing...
Shane
<?
$tables = array('accounts','data');
for($i = 0 ; $i < sizeof($tables) ; ++$i){
$sql = "SELECT * FROM ".$tables[$i];
$r = mysql_query($sql);
if(@mysql_num_rows($r)){
while($row = mysql_fetch_array($r)){
while(list($key,$val) = each($row)){
$fields[] = $$key;
$values[] = addslashes($val);
}
echo "INSERT INTO ".$tables[$i]." (".implode(',',$fields).") VALUES ('".implode('\',\'',$values)."'); \n";
}
}
}
?>
Put that in a file on your server and then from a unix box somewhere you can do
something like this in a crontab to back it up.
0 0 * * * lynx -source http://www.server.com/backup.php > backup.sql
--Joe
================================================================================
= Joe Stump joest...@yahoo.com http://www.miester.org =
================================================================================
"Real programmers don't comment their code.
It was hard to write, it should be hard to understand."