文本显示为多列而不是1

时间:2018-09-06 20:02:08

标签: php html css

我遇到了一个问题,我想将卡中数据库中的文本显示为1列,然后以某种方式将其显示为多列。(文本是一首歌的歌词)。我曾尝试仅为卡添加新的行/列,但这没有用。另外,我正在使用ckeditor,通过该ckeditor可以格式化上述文本并使用mysql保存。

<div class="col-md-7">
    <?php 
    $query = "SELECT * FROM songs";

    $select_all_songs = mysqli_query($conn,$query);

    while($row = mysqli_fetch_assoc($select_all_songs))
    {
        $song_id = $row['id'];
        $song_name = $row['song_name'];
        $song_author = $row['song_author'];
        $song_tags = $row['song_tags'];
        $song_body = $row['song_body'];
        $song_link = $row['video_link'];
        $date = $row['date_of_publishing'];
        ?>

        <h1 class="my-4" ><?php echo $song_name; ?>
          <small></small>
        </h1>

        <!-- Blog Post -->
        <div class="card mb-4">
          <div class="card-image">
            <div class="embed-responsive embed-responsive-16by9 bl">
              <iframe width="560" height="315" src="<?php echo $song_link; ?>" frameborder="0" allowfullscreen></iframe>
            </div>

          </div><!-- card image -->

          <div class="card-content d-flex justify-content-center ">
            <br><br>
            <p ><span class="pesma"><b><?php echo $song_name . "<br><br>"; ?></b></span>
              <?php echo $song_body; ?>
            </p>                    

          </div><!-- card content -->

          <div class="card-footer text-muted">
            Objavljeno - <?php echo $date; ?> -
            <a href="#"><?php echo $song_author; ?></a>
          </div>
        </div>

        <?php }
    ?>


    <!-- Pagination -->

    <ul class="pagination justify-content-center mb-4">
        <li class="page-item">
            <a class="page-link" href="#">&larr; Previous</a>
        </li>
        <li class="page-item">
            <a class="page-link" href="#">Next &rarr;</a>
        </li>
    </ul>
</div>

这是我在屏幕上看到的输出

This is output that i get

文本在数据库中看起来像这样

text looks like this in database

当我将文本从ckeditor添加到数据库时,我没有使用准备好的语句

p inspect element

0 个答案:

没有答案