我使用此代碼來顯示數據庫中的圖像,但它顯示語法錯誤..這裏是我的後端代碼。在php中使用echo語句時出錯?
<?php
echo ' <div id="ib-main-wrapper" class="ib-main-wrapper">';
echo ' <div class="ib-main">';
$sql_select = "select * from tbl_photo";
$sql_select = mysql_query($select_image);
while($data = mysql_fetch_array($sql_select)){
echo "<a href="#"><img src='".$path.$data['photo']."' data-largesrc='".$path.$data['photo']."' /><span>".$data['photo']."</span></a>";
}
echo '</div></div>';
?>
它的靜態代碼:
<a href="#"><img src="images/upload/Desert.jpg" data-largesrc="images/large/Desert.jpg" alt="image01"/><span>Crabbed Age and Youth</span></a>
請給答案..
你得到了什麼錯誤? – hsz