Split SQL data into two responsible columns
Posted: 06 Oct 2017, 05:48
I want to update my notice-board into two column, but i searching for day`s how to complete this...
How can i split this SQL code into two columns for DESC LIMIT off 15 rows.
How can i split this SQL code into two columns for DESC LIMIT off 15 rows.
Code: Select all
<?php
include('../connection.php');
$sql=mysqli_query($conn,"SELECT * FROM `notice_second` ORDER BY `notice_second`.`notice_id` DESC LIMIT 15");
$rehtm='';
// if the $sql contains at least one row
if(mysqli_num_rows($sql) >0){
//get rows data
while($row = mysqli_fetch_assoc($sql)){
$rehtm .='
<img class="img-circle" src="'. $row['poster_picture'] .'" width="50" height="50"/>'. $row['from_who'] .'
Title: '. $row['subject'] .'<br><br>'. $row['Description'] .'<br><br>
<b>My Mood:</b> '. $row['user_mood'] .''. $row['Date'] .'<br><br> ';
}
}
else {
$rehtm .='0 results';
}
echo $rehtm;?>