<meta http-equiv='Content-Type' content='text/html; charset=utf-8' />
<?php
$servername = "sdm163155241.com";
$username = "sdm1655241";
$password = "1746aaa;
// 连接服务器
$con = mysql_connect($servername, $username, $password);
if (!$con)
{
die("Connection failed: " . mysql_error());
}
// 选择数据库
$dbName = "sdm1631efee_db";
$db_selected = mysql_select_db($dbName, $con);
if (!$db_selected)
{
die ("Can\'t DB sdm163155241_db : " . mysql_error());
}
$tabelCount = 1;
$result = mysql_query("SHOW TABLES");
if($result)
{
while($row = mysql_fetch_array($result))
{
echo $tabelCount.": ".$row[0]. "<br/>";
$tabelCount++;
}
}else
{
echo "query result is null";
mysql_close($con)
<?php
$servername = "sdm163155241.com";
$username = "sdm1655241";
$password = "1746aaa;
// 连接服务器
$con = mysql_connect($servername, $username, $password);
if (!$con)
{
die("Connection failed: " . mysql_error());
}
// 选择数据库
$dbName = "sdm1631efee_db";
$db_selected = mysql_select_db($dbName, $con);
if (!$db_selected)
{
die ("Can\'t DB sdm163155241_db : " . mysql_error());
}
$tabelCount = 1;
$result = mysql_query("SHOW TABLES");
if($result)
{
while($row = mysql_fetch_array($result))
{
echo $tabelCount.": ".$row[0]. "<br/>";
$tabelCount++;
}
}else
{
echo "query result is null";
}
mysql_close($con)
?>
显示结果如下图: