php - MySQL: group on timestamp -
i have messages table this:
and want group messages same timestamp secondary table. expected output this:
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
Post a Comment