我一直在使用 URL id 参数从数据库中获取数据。我面临syntax error
同样的问题。谁能告诉我这段代码有什么问题。
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$per = $_GET['id'];
$query = mysql_query("select * from dynamic_data where id=".$_GET['id']");
while($row = mysql_fetch_array($query))
{
echo "<label>" . $row['name'] . "</label>";
echo "<label>" . $row['desc'] . "</label>";
echo "<label>" . $row['cell'] . "</label>";
}
?>