How to display message using bootstrap?

  php, twitter-bootstrap

I’m doing a chat, and I want to display the messages, namely display the name and the message on each row. the problem is the messages are on the left side. In my opinion, I did something wrong with the boostrap, could someone look at the code and see where the error is, because in my opinion it should work but it does not work.

<main>
        <div class="container">
                    <?php
                    $str = new display_message($object);
                    $bot = $str->message();
                    ?>
            <div class="row">
                <div class="col-xl-12">
                    <form action="" method="post">
                        <input type="text" name="message">
                        <button id="send" name="send">Send</button>
                    </form>
                </div>
            </div>
        </div>
    </main>
 if($sql->rowcount())
        {
            while($row= $sql->fetch())
            {
                echo  '<div class="row" id="rows">';
                echo '<div class="col-xl-2">';
                echo $row['last_name'];
                echo '</div>';
                echo '<div class="col-xl-2">';
               echo $row['message'];
                echo '</div>';

                echo '</div>';
                echo '</div>';
            }

        }
        
        

Source: Ask PHP

LEAVE A COMMENT