php - MySQL: group on timestamp -


i have messages table this:

enter image description here

and want group messages same timestamp secondary table. expected output this:

enter image description here

i'm using following script, reason isn't working:

<?php  $message = mysql_query("select * message group member_id"); while($row = mysql_fetch_array($message)) {     @mysql_query("insert message2                   values                 ('$row[time_recorded]','$row[member_id]',                  '$row[message]')"); } 

use select *, group_concat(message separator ', ') message message group member_id in first selection.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -