中文字幕在线观看,亚洲а∨天堂久久精品9966,亚洲成a人片在线观看你懂的,亚洲av成人片无码网站,亚洲国产精品无码久久久五月天

如何連接mysql數(shù)據(jù)庫(kù)?

我司的Mysql可以在虛擬主機(jī)管理中心》數(shù)據(jù)庫(kù)》管理mysql數(shù)據(jù)庫(kù)(http://mysql.myhostadmin.net),直接在線管理,您也可以自己下載一個(gè)Phpmyadmin上傳至您的空間里面進(jìn)行數(shù)據(jù)庫(kù)的管理。


下面的例子是用PHP4連接一個(gè)mysql數(shù)據(jù)庫(kù)操作的演示

<?
    /*本例是用PHP4連接一個(gè)mysql數(shù)據(jù)庫(kù)操作的演示,
    實(shí)現(xiàn)連接打開一個(gè)庫(kù),并讀取數(shù)據(jù)的基本功能。
    */
?>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<style type="text/css">
<!--
input { font-size:9pt;}
A:link {text-decoration: underline; font-size:9pt;color:000059}
A:visited {text-decoration: underline; font-size:9pt;color:000059}
A:active {text-decoration: none; font-size:9pt}
A:hover {text-decoration:underline;color:red}
body,table {font-size: 9pt}
tr,td{font-size:9pt}
-->
</style>
<title>注冊(cè)會(huì)員列表 - 讀取mysql的測(cè)試</title>
</HEAD>
<body alink="#FF0000" link="#000099" vlink="#CC6600" topmargin="8" leftmargin="0" bgColor="#FFFFFF">
<br><br><center><font color=green size=3><b>注 冊(cè) 會(huì) 員 列 表</b></font></center>
<br>
<table cellspacing=0 bordercolordark=#FFFFFF width="95%" bordercolorlight=#000000 border=1 align="center" cellpadding="2">
  <tr bgcolor="#6b8ba8" style="color:FFFFFF">
    <td width="5%" align="center" valign="bottom" height="19">ID</td>
    <td width="10%" align="center" valign="bottom">姓名</td>
    <td width="5%" align="center" valign="bottom">性別</td>
    <td width="5%" align="center" valign="bottom">年齡</td>
    <td width="20%" align="center" valign="bottom">聯(lián)系電話</td>
    <td width="20%" align="center" valign="bottom">電子郵件</td>
    <td width="20%" align="center" valign="bottom">家庭住址</td>
  </tr>
<?
    //連接到本地mysql數(shù)據(jù)庫(kù)
    $myconn=mysql_connect("localhost","root","");
    //選擇test為操作庫(kù)
    mysql_select_db("test",$myconn);
    $strSql="select * from reguser";
    //用mysql_query函數(shù)從user表里讀取數(shù)據(jù)
    $result=mysql_query($strSql,$myconn);
    while($row=mysql_fetch_array($result))//通過循環(huán)讀取數(shù)據(jù)內(nèi)容
    {
?>
  <tr>
    <td align="center" height="19"><?echo $row["id"]?></td>
    <td align="center"><?echo $row["userid"]?></td>
    <td align="center"><?echo $row["sex"]?></td>
    <td align="center"><?echo $row["age"]?></td>
    <td align="center"><?echo $row["tel"]?></td>
    <td align="center"><?echo $row["email"]?></td>
    <td align="center"><?echo $row["address"]?></td>
  </tr>
<?
    }
    //關(guān)閉對(duì)數(shù)據(jù)庫(kù)的連接
    mysql_close($myconn);
?>
</table>
</BODY>
</HTML>

編輯:west263
日期:2003-09-26

收藏 】 【 打印 】   
您可對(duì)文檔進(jìn)行評(píng)分喲~

勾選遇到的問題提交給我們,收到反饋后保證及時(shí)修正更新!

提交反饋需要先登陸會(huì)員帳號(hào)

上一篇:如何用asp的jmail發(fā)郵件?
下一篇:如何連接我的數(shù)據(jù)庫(kù)?
若文檔內(nèi)容對(duì)您沒有幫助,不能解決問題? 您還可以 咨詢?cè)诰客服提交工單搜索常見問題 ,我們將竭誠(chéng)為您服務(wù)。
  >> 相關(guān)文章
  沒有相關(guān)文章。
分享至:
Top

24小時(shí)客服熱線

400-028-5800

028-62778877

  • 售前咨詢請(qǐng)撥4
  • 售后服務(wù)請(qǐng)撥5
  • 技術(shù)支持請(qǐng)撥7
  • 投訴建議請(qǐng)撥9
  • 備案問題請(qǐng)提交工單

咨詢售后問題請(qǐng)先打開 電話助手