這個程式可以用來瀏覽MySQL中的資料,您可以稍做修改就可以做出很不錯的MySQL瀏覽器.
*/
/*
?cmd=db
?cmd=table&db={}
?cmd=record&db={}&table={}
*/
$host = 'localhost';
$user = 'test';
$password = '';
if(!isset($cmd)) $cmd = 'db';
switch($cmd){
case 'db':
break;
case 'table':
break;
case 'record':
🎜> break;
}
$con = @mysql_connect($host,$user,$password) or die('無法連線'.$host);
switch($cmd){
case 'db':
$dbs = mysql_list_dbs($con) or die('mysql_list_dbs 出錯:'.$php_errmsg);
base/host. 13);
$num_rows = mysql_num_rows($dbs);
for($i=0;$i echo ' urlencode($db).'&table='.urlencode($table).'">'.$table.code($db).'&table='.urlencode($table).'">'.$table.'
' .
chr(13);
}
$PHP_SELF.'?cmd=db">show databases'.chr(13);
break;
case 'record':
$records = myg_db_query($db_select $records = my_db_query($ die('mysql_db_query 出錯:'.$php_errmsg);
echo 'records on '.$table.':
'.chr(13);
"0" cellpadding="0">'.chr(13);
echo '