Últimos 10 mensajes multimedia en la BD"; echo ""; $conversations = $db->fetchAll(" SELECT c.id, c.user_id, u.phone_number, c.direction, c.message_type, c.content, c.media_url, c.created_at FROM conversations c LEFT JOIN users u ON c.user_id = u.id WHERE c.message_type IN ('image', 'audio', 'video', 'document') ORDER BY c.created_at DESC LIMIT 10 "); echo "
| ID | Teléfono | Dir | Tipo | Content | Media URL | Fecha |
|---|---|---|---|---|---|---|
| {$msg['id']} | "; echo "{$msg['phone_number']} | "; echo "{$msg['direction']} | "; echo "{$msg['message_type']} | "; echo "" . htmlspecialchars(substr($msg['content'], 0, 200)) . " | ";
echo "" . htmlspecialchars(substr($msg['media_url'], 0, 100)) . " | ";
echo "" . date('H:i:s', strtotime($msg['created_at'])) . " | "; echo "