--
-- Struktura tabeli dla `phpbb_posts`
--
CREATE TABLE `phpbb_posts` (
`post_id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
`topic_id` mediumint(8) UNSIGNED NOT NULL DEFAULT '0',
`forum_id` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
`poster_id` mediumint(8) NOT NULL DEFAULT '0',
`post_time` int(11) NOT NULL DEFAULT '0',
`poster_ip` varchar(8) NOT NULL DEFAULT '',
`post_username` varchar(25) DEFAULT NULL,
`enable_bbcode` tinyint(1) NOT NULL DEFAULT '1',
`enable_html` tinyint(1) NOT NULL DEFAULT '0',
`enable_smilies` tinyint(1) NOT NULL DEFAULT '1',
`enable_sig` tinyint(1) NOT NULL DEFAULT '1',
`post_edit_time` int(11) DEFAULT NULL,
`post_edit_count` smallint(5) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`post_id`),
KEY `forum_id` (`forum_id`),
KEY `topic_id` (`topic_id`),
KEY `poster_id` (`poster_id`),
KEY `post_time` (`post_time`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;
--
-- Struktura tabeli dla `lo_comments`
--
CREATE TABLE `lo_comments` (
`comment_id` mediumint(9) NOT NULL AUTO_INCREMENT,
`news_id` mediumint(9) NOT NULL DEFAULT '0',
`comment_time` int(13) NOT NULL DEFAULT '0',
`poster_id` mediumint(9) NOT NULL DEFAULT '0',
`comment_text` text NOT NULL,
`comment_edited` int(13) NOT NULL DEFAULT '0',
PRIMARY KEY (`comment_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=21 ;
No i skonstruowałem sobie takie zapytanie, tylko nie wiem co dalej i czy w ten sposób coś osiągnę:
<?php
$sql = "SELECT p.*, c.*
FROM " . POSTS_TABLE . " p, " . COMMENTS_TABLE . " c
WHERE p.poster_id = " . $profiledata['user_id'] . "
AND c.poster_id = " . $profiledata['user_id'] . "
ORDER BY p.post_time
AND c.comment_time
DESC
LIMIT 0, 10";
?>