【发布时间】:2018-03-08 08:14:00
【问题描述】:
我在这里创建了客户的链接。
<a name="id" href="https://127.0.0.1/new taxicab/account/driver/profile/index.php?id=<?php echo $data['id']; ?>"><?php echo $data['fullname']; ?></a>
index.php 是
<?php $connection = new mysqli("localhost", "root", "black9024!@","new_taxicab");
$id = ($_GET['id']);
if (empty($_GET['id'])){
header("location:cheat.php");
die();
$sql = "select * from driver where id = '$id'";
$result = $db->sql_query($sql) or die (mysqli_error($sql));
while($rws = mysqli_fetch_array($result)){}
echo $rws['fullname'];?>
<?php echo $rws['fullname'];
}
?>
但它不能工作我知道它错了但是写的是什么请给我一些建议。
【问题讨论】:
-
你的id字段是
string吗? -
没有我上面的 html id 是一个字符串,它直接来自数据库
-
如果是这样,那么在你的 inde.php 文件中你应该有
id = $id(查询),并且你没有指定当前代码有什么问题