列表代码
<?php $con = mysql_connect("localhost:3306","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("test", $con); $res<p>+本文来源gao!%daima.com搞$代*!码9网(</p><strong>搞gaodaima代码</strong>ult = mysql_query("SELECT * FROM user"); echo "<table border='1'> <tr> <th>Username</th> <th>Password</th> </tr>"; while($row = mysql_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['username'] . "</td>"; echo "<td>" . $row['password'] . "</td>"; echo "</tr>"; } echo "</table>"; mysql_close($con);?>
删除
添加
修改
<title>用PHP向数据库中实现简单的增删改查</title> <body> <br /> <h1>Insert:</h1> username: <br /> password: <br /><hr /><br /> <h1>Delete</h1> username: <br /> Are you sure? <br /><hr /><br /> <h1>Update</h1> username: <br /> You want to change your password into: <br /><hr /><br />
以上所述就是本文的全部内容了,希望大家能够喜欢。