Share a php MYSQL backup class library and a phpmysql backup class library. Share a php class library for MYSQL backup. the phpmysql backup class library just needs to study how to back up the database and share a php class library for MYSQL backup? Php ****** share a php class library for MYSQL backup and phpmysql backup
I just want to study how to back up the database and share a php class library for MYSQL backup.
Query ("show create table $ table"); $ create = $ db-> fetch_row ($ createtable); $ tabledump. = $ create [1]. "; \ n"; return $ tabledump;}/******* back up the database structure and all data ****** // * function name: data2sql () function: converts the table structure and data into SQL function parameters: $ table: return value of the table name to be extracted: return the extracted result, SQL collection function author: heiyeluren */function data2sql ($ table) {global $ db; $ tabledump = "DROP TABLE IF EXISTS $ table; \ n "; $ createtable = $ db-> query ("show create table $ table "); $ Create = $ db-> fetch_row ($ createtable); $ tabledump. = $ create [1]. "; \ n"; $ rows = $ db-> query ("SELECT * FROM $ table"); $ numfields = $ db-> num_fields ($ rows ); $ numrows = $ db-> num_rows ($ rows); while ($ row = $ db-> fetch_row ($ rows) {$ comma = ""; $ tabledump. = "insert into $ table VALUES ("; for ($ I = 0; $ I <$ numfields; $ I ++) {$ tabledump. = $ comma. "'". mysql_escape_string ($ row [$ I]). "'"; $ comma = "," ;}$ Tabledump. = "); \ n" ;}$ tabledump. = "\ n"; return $ tabledump ;}?>
Http://php.662p.com/thread-560-1-1.html
Ghost just wants to study how to back up the database and share a php class library for MYSQL backup? Php/****** back up the database structure...