这是我创建的测试数据库:
PHP服务端代码:
$info = $_GET["info"];
$conn = mysqli_connect('localhost','root','','myOneDB');
if (!$conn)
{
die('连接失败' . mysqli_error($conn));
}
else
{
echo "连接成功";
}
$result = mysqli_query($conn,"SELECT * FROM TableOne WHERE id = '".$info."'");
while($row = mysqli_fetch_array($result))
{
echo $row['id'].$row['name'].$row['phone'].$row['regist_time'];
}
mysqli_close($conn);
网页:
OK,这样就可以愉快地玩耍了!