Please help!
This is my fetch_conversation_summary function
function fetch_conversation_summary(){ $sql = "SELECT `conversations`.`conversation_id`, `conversations`.`conversation_subject`, MAX(`conversations_messages`.`message_date`) AS `conversation_last_reply` FROM `conversations` LEFT JOIN `conversations_messages` ON `conversations`.`conversation_id` = `conversations_messages`.`conversation_id` INNER JOIN `conversations_members` ON `conversations`.`conversation_id` = `conversations_members`.`conversation_id` WHERE `conversations_members`.`user_id` = {$_SESSION['user_id']} AND `conversations_members`.`conversation_deleted` = 0 GROUP BY `conversations`.`conversation_id` ORDER BY `conversation_last_reply` DESC"; $result = mysql_query($sql); $conversations = array(); while(($row = mysql_fetch_assoc($result)) !== false){ $conversations[] = array( 'id' => $row['conversation_id'], 'subject' => $row['conversation_subject'], 'last_reply' => $row['conversation_last_reply'] ); } return $conversations; }This is my php part of inbox.inc.php page :
<?php $conversations = fetch_conversation_summary(); print_r($conversations); ?>