推出全新OEM分銷體系
具有殺傷力的價(jià)格,超大利潤(rùn)
如何連接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ù)操作的演示, 實(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>
|
|||||
>> 相關(guān)文章 | |||||
沒有相關(guān)文章。 | |||||
關(guān)注我們
最新動(dòng)態(tài)
新浪微博
交流互動(dòng)
關(guān)于我們
|
聯(lián)系我們
|
付款方式
|
人才招聘
|
友情鏈接
|
域名資訊
|
提交工單
|
我要評(píng)價(jià)
|
投訴建議
|
域名投訴
|
網(wǎng)站備案
|
百科知識(shí)
|
手機(jī)站
《中華人民共和國(guó)增值電信業(yè)務(wù)經(jīng)營(yíng)許可證》編號(hào):B1-20172600 川B1-20080058 蜀ICP備12028237號(hào)
《中華人民共和國(guó)互聯(lián)網(wǎng)域名服務(wù)許可證》編號(hào):川 D3-20220002
電話總機(jī):028-62778877(20線) 400電話:400-028-5800