我正在尝试填充使用( port_id=$project )创建的页面。单个帖子页面有效,并且正在填充,但由整个表而不是仅具有相同 ID 的行填充。这是我的单页代码:
$db = dbconnect('test');
$sql = 'SELECT * FROM portfolio';
$result = $db->query($sql) or die(mysqli_error());
$currportfolio = $_GET['port_id'];
while($row = $result->fetch_assoc()){
$project = $row['port_id'];
echo "
<div class='post-img bottom-50'>
<h3 class='bottom-20'><a href='blog-single.html'>Consectetur adipisicing elit</a></h3>
<div class='proj-img1 bottom-20'>
<a class='prettyPhoto zoom' href='upload/".$row['image']. "'>
<img src='images/content/portimg.jpg' alt=''></a>
</div>
<p>".$row['description'] . "</p>
</div>
</div>
";}