I am trying to show all of the users from the database.And adding tabledate of each user so i think i have sytnax problem with my html code in php variable.
include('connection.php');
session_start();
$userId=$_SESSION['userId'];
$sql="SELECT* FROM user WHERE user_id !='$userId'";
$query=mysqli_query($conn,$sql);
$output ='<table class ="table table-bordered table-striped">
<tr>
<td>Username</td>
<td>Status</td>
<td>Status</td>
</tr>
';
while($result=mysqli_fetch_assoc($query)) // THIS LOOP IS WORKING FINE BUT WHEN I TRY TO ADD TABLE COLUMS I GOT ERROR
{
$output .= '
<tr>
<td>'.$result['user_name'].'</td>
<td>/<td>
<td><button type="button" class="btn btn-info btn-xs start_chat" data-touserid=" '$result['user_name']' ">Start Chat</button></td>
</tr>
';
}
$output .= '</table>';
echo $output;
?>