如何显示来自mysql的数据PHP不在表中但在段落[复制]中

This question already has an answer here:

As written in the tittle I would like the data to be displayed in paragraph not in a table. Can please anyone help me. This is my working code, data is displayed in a table. BUT I would like to be displayed in paragraphs not in tr/th.

<!DOCTYPE html>
<html lang="pl-PL">
<head>
</head>
<body>
<table>
<tr>
    <th>Content</th>
</tr>    
<?php
session_start();
$username = "";
$email    = "";
$errors = array();
$_SESSION['success'] = "";

$mysqli = mysqli_connect('localhost', 'root', '', 'cms');
 ?>

<?php

$query ="SELECT * FROM articles";

$result = $mysqli->query($query) or die($mysqli->error.__LINE__);

         if($result->num_rows > 0) {

            while($row = $result->fetch_assoc()){
echo "<tr><td>" .$row['article_content'] ."</td><tr>";

            }
        }
 ?>
</table>
</body>
</html>
</div>

Just change your HTML to remove the table-related code, and replace it with paragraph elements. Note that your session_start is going to fail with your existing code as it will attempt to send headers but PHP will have already sent headers as soon as it encountered the HTML in the document. So you need to move the session_start code to the beginning of the file.

<?php
session_start();
?>
<!DOCTYPE html>
<html lang="pl-PL">
<head>
</head>
<body>
<h1>Content</h1>  
<?php
$username = "";
$email    = "";
$errors = array();
$_SESSION['success'] = "";

$mysqli = mysqli_connect('localhost', 'root', '', 'cms');
//Create the select query
$query ="SELECT * FROM articles"; 
$result = $mysqli->query($query) or die($mysqli->error.__LINE__);
if($result->num_rows > 0) {
    //Loop through results
    while($row = $result->fetch_assoc()){
        echo "<p>" .$row['article_content'] ."</p>";
    }
}
?>
</body>
</html>

Try this:

echo "<p>" .$row['article_content'] ."</p>";

remove table tags from the file.