文章詳情頁(yè)
PHP 存取 MySQL 數(shù)據(jù)庫(kù)的一個(gè)例子
瀏覽:3日期:2024-01-17 16:20:08
<body> <center> <h2>PHP+MySQL 例子</h2> <h3><u><font color=brown>請(qǐng)?jiān)谖谋緟^(qū)域輸入數(shù)據(jù)并且確定 </font></u></h3> <form action="<? echo $PHP_SELF?>" method=POST> <textarea cols=40 rows=5 name=txt></textarea> <br> <input type="submit" value="確定">;;</form> <? ;;$connect_id=mysql_connect("localhost","username","password"); ;;if(isset($txt)) { ;;;;;$dbtime=date("Y-m-d H:i:s"); ;;;;;mysql_db_query("usernamedb","insert into test values (0,'$dbtime','$txt')"); ;;} ?> <p> </center> <div align=center><center> <table border=1 cellpadding=0 cellspacing=2 width=80%> <tr><td> <? ;;$result=mysql_db_query("usernamedb","select * from test"); ;;while($userdb=mysql_fetch_row($result)) ;;{ ;;;;;echo "<".$userdb[0].">:;;;;;;<font color=purple>".$userdb[1]."</font>;;;;;<font color=red>".$userdb[2]."</font><br>n";} ;;;mysql_close($connect_id); ?> </td></tr> </table> <p> </body> </html>;;【本文版權(quán)歸作者與奧索網(wǎng)共同擁有,如需轉(zhuǎn)載,請(qǐng)注明作者及出處】;;;;
標(biāo)簽:
PHP
排行榜
