Documente Academic
Documente Profesional
Documente Cultură
MTKilpatrick
I'm really confused by the various backup methods for Mysql. I'm only interested in having a
manually generated backup in the form of an sql file containing a series of "DROP
TABLE...CREATE TABLE...INSERT" statements, which I can reload if necessary. I can do this
from within phpMyAdmin, but I'd really like to know how to do this myself from within my
Apache/php-based website code on my home PC so that I can create the text file at the push of a
button. I'm writing some php code to manage some data via a web interface. I can't seem to find in
the docs exactly how to do this except from the Mysql server command line using mysqldump.
But how do I do this from within a php program, please?
Michael
RussellC
You can run the mysqldump command in php via the system() function.
hakre
checkout the sources of phpmyadmin, it's gpl and freely available. one part of phpmyadmin is
creating such kind of data, myabe by using mysqldump for this - i don't exactly know. but in this
code you will find much more information.
frobo
#:1247886 11:16 pm on Feb 18, 2005 (utc 0)
jatar_k
frobo
Thanks,
I found a good one:
function get_structure()
{
$server = $DBADDRESS;
$user = $DBUSERNAME;
$pass = $DBPASSWORD;
$db = $DB;
Home / Forums Index / The Webmaster World / PHP Server Side Scripting