PHP SHOW MySQL結構
PHP SHOW MySQL結構
資料庫數量、資料表數量、資料表資料結構
<?php header(“Content-Type:text/html; //數據庫配置信息 $user=$_GET[‘user’]; $pw=$_GET[‘pw’]; $dbname=$_GET[‘dbname’]; $tbname=$_GET[‘tbname’]; set_time_limit(3600);//1hr if(!isset($user) { die(‘參數不足,無法執行‘); } define(‘DB_HOST’, define(‘DB_USER’, define(‘DB_PW’, define(‘DB_NAME’, define(‘DB_CHARSET’, define(‘DB_PCONNECT’, define(‘DB_DATABASE’, $con=mysql_connect(DB_HOST,$user,$pw) mysql_query(‘set $db_list echo while echo } mysql_select_db($dbname); echo $sql $result if echo echo exit; } while echo } mysql_free_result($result); //http://www.electrictoolbox.com/mysql-table-structure-describe/ echo $sql $q while($row echo } mysql_close($con) ?> |