备份: 1.首先查询出当前数据库中所有的表$tables(SHOW TABLE STATUS FROM $dbname); 2.遍历循环每个表, foreach ( $tables as $table ) { $output .= $backupModel->data2sql ( $table ); } 根据表名查询出字段信息,然后进行把数据导出 function data2sql($table) { $conn = mysql_connect ( "localhost", “root”, "123456" ); mysql_select_db ( "dbname" ); mysql_query ( "set names utf8" ); $tabledump = "drop table if exists $table;n"; $createtable = mysql_query ( [...]
Categories: PHP编程



