Jump to content


Photo

Database Backup


  • Please log in to reply
2 replies to this topic

#1 Cruisecar

Cruisecar
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 10 October 2006 - 06:26 PM

I have a huge MySQL Database, with many tables, and data within.

Currently I backup the Database by running a dump from phpMyAdmin. I need to know the php code needed to do so automaticly (I will program it so it does so every 12 hours). I've made my own script that can backup individual tables, but need a way of backing up the whole database in one go.

I cannot use any of the methods mentioned on this site http://www.php-mysql...-backup-php.php, due to security features on my host.

Any help would be appreciated,

Thankyou.

#2 Daniel0

Daniel0
  • Staff Alumni
  • Advanced Member
  • 11,956 posts

Posted 10 October 2006 - 06:30 PM

If you can do one table, then just do this:
$query = mysql_query("SHOW TABLES FROM db_name_here");
while($table = mysql_fetch_row($query))
{
	$table = $table[0];
	// do your stuff here
}


#3 Cruisecar

Cruisecar
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 10 October 2006 - 06:52 PM

You are a genious! That is exactly what is was looking for.

Thankyou.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users