Echo inside div with nested echo
P粉818317410
P粉818317410 2024-04-04 11:09:23
0
1
506

I'm trying to use echo

in this code
<?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
    }
?>

I get this errorParse Error: Syntax error, unexpected string content "", expecting "-" or identifier or variable or number at line C:\xampp\htdocs\desk\gallery.php 572 Why does this error occur? ................................................................. ....…………

P粉818317410
P粉818317410

reply all(1)
P粉348915572

You can escape the string and concatenate the variable where you want it, like this:


    
        

"; ?>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template