Im trying to use one query to fetch information from 3 tables. I'm just not sure how to do so, currently I have joined 2, but im not sure how i would do this..

first here is the database structure..
table 1
Code:
CREATE TABLE `notes` (
  `id` mediumint(9) NOT NULL auto_increment,
  `userid` mediumint(9) NOT NULL default '0',
  `ts` datetime NOT NULL default '0000-00-00 00:00:00',
  `sticky` enum('1','0') NOT NULL default '0',
  `announce` enum('1','0') NOT NULL default '0',
  `title` varchar(255) NOT NULL default '',
  `text` text NOT NULL,
  `edit` varchar(200) NOT NULL default '',
  KEY `id` (`id`)
) TYPE=MyISAM;
table 2
Code:
CREATE TABLE `notes_comment` (
  `id` mediumint(9) NOT NULL auto_increment,
  `noteid` mediumint(9) NOT NULL default '0',
  `userid` mediumint(9) NOT NULL default '0',
  `ts` datetime NOT NULL default '0000-00-00 00:00:00',
  `title` varchar(255) NOT NULL default '',
  `text` text NOT NULL,
  `edit` varchar(255) NOT NULL default '',
  KEY `id` (`id`)
) TYPE=MyISAM;
table 3
Code:
CREATE TABLE `users` (
  `id` int(11) NOT NULL auto_increment,
  `sid` text NOT NULL,
  `user` tinytext NOT NULL,
  `pass` varchar(80) NOT NULL default '',
  KEY `id` (`id`)
) TYPE=MyISAM;
what I'm trying to do is get id, userid, title, text, ts, sticky, announce from table1 (notes),

count the number of comments using the id from table1 in table2 sorted by noteid count(noteid)

and getting the user from table 3 using userid from table 1.

so far I can join 2 tables and get everything cept for the comment count..

here is the query im currently using..
PHP Code:

    $query 
"select distinct u.id, 
                i.id as id, 
                i.userid as userid, 
                i.sticky as sticky, 
                LEFT(i.title, 55) as title, 
                i.text as text, 
                DATE_FORMAT(i.ts, '%b %e, %Y at %h:%i%p') as ts, 
                u.user as username 
                    from notes as i, 
                    users as u 
                        inner join users on u.id = i.userid 
                            where i.announce != '1' and i.id = '"
$_GET['id'] ."'"
Ive thought about using a temp heap table but I would be stuck again cause I'm not sure how i would get all the information i would need into each row.

under normal circumstances i could use 2 or even 3 queries but the currently template system would not work (bTemplate) so it has to be done with one query..

TiA