I hav a syntax error in While
<?php
$query = "SELECT * FROM users";
$sql = mysqli_query($link, "SELECT * FROM users img_file WHERE id='$id' ");
$_SESSION['id'] = $id;
$result=mysqli_query($link, "SELECT * FROM `textArea` WHERE id='$id'"); // запрос на выборку
$result = mysqli_query($link, $query) or die(mysqli_error($link));
function get_text($id) {
$singles = mysqli_query($link, "SELECT * FROM users WHERE id='$id'");
foreach ($singles as $single) {
return $single;
}
}
while($row=mysqli_fetch_assoc($result))
{
if(!empty($row['textArea']))
echo '<div class="media mb-4 p-4 status-content">' .
// This while syntax error
while ($row = mysqli_fetch_assoc ($sql)) {
if (!$row['img_file']) {
echo '<img class="mr-5 avatar" src="https://themes.3rdwavemedia.com/instance/bs4/assets/images/profile.jpg"/>';
} else {
echo "<img class='mr-5 avatar' style='width:300px; border-radius: 100%;height: 300px;' src='" . $row['img_file'] . "' alt='' />";
}
}
'<div class="media-body">' .
'<h4 class="text-author text-warning">' . $row['login'] . '</h4>' .
'<p class="text-white">' . $row['textArea'] . '</p>' .
'</div>'.
'</div>';
}
?>