Ich versuche, Echo in diesem Code zu verwenden
<?php require 'connect.php'; $query = mysqli_query($conn, "SELECT * FROM `videos`") or die(mysqli_error()); while($fetch = mysqli_fetch_array($query)){ $id= $fetch['id']; ?> <?php echo " <li class='col-lg-4 col-md-6 col-dm-12'> <div class='da-card box-shadow'> <div class='da-card-photo'> <img src=' echo $fetch['video_name']' alt=''> <div class='da-overlay'> <div class='da-social'> <h4 class='mb-10 color-white pd-20'></h4> <ul class='clearfix'> <li> <a href='' data-fancybox='images'><i class='fa fa-picture-o'></i></a> </li> <li> <a href='#'><i class='fa fa-link'></i></a> </li> </ul> </div> </div> </div> </div> </li> "; ?> <?php } ?>
Ich habe diesen Fehler erhalten Parse 错误:语法错误,意外的字符串内容“”,期望“-”或标识符或变量或数字位于 C:xampphtdocsdeskgallery.php 行 572
Warum tritt dieser Fehler auf?
................................................. ............... ....…………
您可以转义字符串并将变量连接到您希望的位置,如下所示: