我必须插入数据库的链接。但它们应该在我的网站上作为照片打开吗?
<?php
if(isset($_SESSION['logged_in']) )
{
$selektimi = 'SELECT titulli ,foto , pershkrimi FROM portofolio';
$result = mysqli_query($conn, $selektimi) or die ('invalid query:'. mysqli_error($conn));
while($row = mysqli_fetch_row($result))
{
list( $titulli, $foto, $pershkrimi)=$row;
echo nl2br('<h2>'.$titulli.'</h2>');
echo '<img src="'.$row['$foto'].'">';
echo nl2br('<p>'.$pershkrimi.'</p>');
echo'<hr>';
}
}
?>
答案 0 :(得分:2)
<?php
//Connect to DB
//query
<img src="'.$row['url'].'">
//replace url with whatever your column name is
?>