我在尝试获取项目的详细信息页面时遇到此错误。它对于学校而言我还不太了解PHP。 “您的SQL语法中有错误;请查看与您的MySQL服务器版本对应的手册,以便在第1行的''附近使用正确的语法”
以下是该页面的代码。
<?php
require_once('connection.php');
mysqli_select_db($conn, $dbname);
$recordID = $_GET['recordID'];
$query_Shoe_Details = "SELECT * FROM Products WHERE Shoe_Brand = $recordID";
$Shoe_Details = mysqli_query($conn, $query_Shoe_Details) or die(mysqli_error(($conn)));
$row_Shoe_Details= mysqli_fetch_assoc($Shoe_Details);
$totalRows_Shoe_Details = mysqli_num_rows($Shoe_Details);
?>
<!DOCTYPE html>
<html>
<head>
<title>details</title><?php include 'connection.php';?>
</head>
<body>
<p>Product Name: <?php echo $row_Shoe_Details['Product_Name']; ?></p>
<p><img src=
"images/%3C?php%20echo%20$row_Shoe_Details['Image_Name'];%20?%3E"></p>
<p>Description: <?php echo $row_Shoe_Details['Product_Description']; ?></p>
<p>Price: $<?php echo $row_Shoe_Details['Product_Price']; ?></p><?php
mysqli_free_result($Shoe_Details);
?>
</body>
</html>
答案 0 :(得分:0)
将您的查询更改为,使用单引号
Dynamic programming
同时删除此 $query_Shoe_Details = "SELECT * FROM Products WHERE Shoe_Brand = '$recordID'";
,无需再次添加
答案 1 :(得分:0)
input[type=radio]:not(old) + label:after{
content: '';
position: absolute;
top: 0;
left: 23px;
width: 100%;
height: 100%;
z-index: -1;
background : url('radio.png') no-repeat 0 0;