Go2Net! Ha! No wonder they went under. MySQL _STILL_ doesn't support transactions.
I do this:
"SELECT users.uid, users.name, users.mail, users.created, count(*) AS posts FROM users, comments WHERE users.uid = comments.uid AND users.uid > 0 GROUP BY users.uid, users.name, users.mail, users.created ORDER BY " . $sort
Then I add the result of:
"SELECT count(*) FROM node WHERE uid = " . $uid
For every line as I generate the output table.
Posted by tendiamonds on 2005-07-26 19:37:47 +0000
I hope frame is bored to death.
I assume then that this is in php... if so, you can get all your data up front from mySql, and then deal with the output arrays in a perl-like manner. You should be able to do a query that gets users and count from each table, then merge them yourself, then sort, then make the html... no?
Posted by tendiamonds on 2005-07-26 19:40:39 +0000
Go2Net may have sucked, but they did not go out of business, they were bought by InfoSpace. InfoSpace is still my favorite white pages online.
Posted by tgl on 2005-07-26 20:07:53 +0000
Yeah, I could do that. I'm not too familiar with PHP (yet). I was hoping that I could do it all with SQL. (Even though my company is currently having an ERP system installed that is written entirely in SQL. Yuck!)
<a href="http://www.htmlite.com/php025.php">Here we go.</a>
Posted by rladew on 2005-07-26 21:05:08 +0000
_______________________________
Posted by Miriam on 2005-07-26 21:24:03 +0000
22 posts ARE awesome
Posted by tgl on 2005-07-27 02:33:42 +0000
Who is sleeping now?! (Not <a href="/gang">me</a>.)
Posted by frame609 on 2005-07-27 02:36:20 +0000
Hours to go. Like six.
Posted by rladew on 2005-07-27 03:20:21 +0000
eh?
_______________________________
Posted by tendiamonds on 2005-07-27 03:20:27 +0000
Looks hot... but now everyone's numbahz look inflated? Why can't I hold down my top 5 spot!?
Posted by rladew on 2005-07-27 03:29:53 +0000
last one. no more google images for me.
_______________________________
Posted by pamsterdam on 2005-07-27 06:02:53 +0000
Wait, G - he didn't beat you - you beat him!!!
Wooooooooooooo! Girl power!
(in case you don't recognise us, that's Dina, me, Miriam, G, and Jenny at a Malbert costume party a few years ago... good times.)
Posted by tgl on 2005-07-27 13:34:35 +0000
It wasn't counting blog or poll nodes. Now it is. One problem: I'm using the thing I want to sort with as the key into the associative array. That means a person might not get listed if some else after them in the user query has the same post total.
I can sort by value, but, not sure if that means the first element in the value array or some weird magical accumulation of the value array.
I could probably look it up.
Posted by tendiamonds on 2005-07-27 13:59:54 +0000
Well done, tgl. Using the count as the key is so ugly it's pretty again.
Posted by Miriam on 2005-07-27 14:34:24 +0000
I've always wanted to be that tan!
Posted by dawnbixtler on 2005-07-27 15:20:52 +0000
Posted by Miriam on 2005-07-27 15:27:12 +0000
Is that pussy dead or just wet?
Posted by Miriam on 2005-07-27 15:56:19 +0000
Ooh! Ooh! I'm in the top 8! I love being on top!
Posted by G lib on 2005-07-29 13:43:14 +0000
BABY SPICE?!?!?!?!?!?
.
You are SO not my friend anymore, Pamsterdam.
.
Ach, who am I kidding. Baby spice+SoccerMom = G Lib.
.
(Just kidding, Pam!)
________________
<i>--Feminazi </i>
Posted by tendiamonds on 2005-07-29 16:49:27 +0000
Awesome, tgl, I love it.
Posted by rladew on 2005-07-29 16:56:53 +0000
Party like its...
_______________________________
Posted by rladew on 2005-07-29 16:57:10 +0000
1999!
_______________________________
Posted by rladew on 2005-07-29 16:57:37 +0000
rladew moves on to the year 2000!!!!!
_______________________________
Posted by tendiamonds on 2005-07-29 17:32:28 +0000
Oh, I get it... there's that bug you have when you don't show up on the list if you have the same number of posts as someone else... (well, one of you doesn't) So I disappeared as I was dethroning G-Lib from the Top5... woo hoo!
Posted by pamsterdam on 2005-08-08 08:21:25 +0000
Baby Spice is the cutest.
Is this the real reason you didn't come to the Model?
Its gonna take more time patience and effort to best mike f or tgl on this I'm afraid.
"TGL's Got the 10 1/2"!!!!!!!!
_______________________________
________________
<i>--Feminazi </i>
_______________________________
+-----+
|users|
+-----+
|uid |
+-----+
+-----+
|node |
+-----+
|nid |
|uid |
+-----+
+-----+
|comments
+-----+
|cid |
|uid |
|nid |
+-----+
I want to count and then order by the number of posts for a user (uid) in the comments and node tables.
I do this:
"SELECT users.uid, users.name, users.mail, users.created, count(*) AS posts FROM users, comments WHERE users.uid = comments.uid AND users.uid > 0 GROUP BY users.uid, users.name, users.mail, users.created ORDER BY " . $sort
Then I add the result of:
"SELECT count(*) FROM node WHERE uid = " . $uid
For every line as I generate the output table.
I assume then that this is in php... if so, you can get all your data up front from mySql, and then deal with the output arrays in a perl-like manner. You should be able to do a query that gets users and count from each table, then merge them yourself, then sort, then make the html... no?
<a href="http://www.htmlite.com/php025.php">Here we go.</a>
Wooooooooooooo! Girl power!
I can sort by value, but, not sure if that means the first element in the value array or some weird magical accumulation of the value array.
I could probably look it up.
.
You are SO not my friend anymore, Pamsterdam.
.
Ach, who am I kidding. Baby spice+SoccerMom = G Lib.
.
(Just kidding, Pam!)
________________
<i>--Feminazi </i>
_______________________________
_______________________________
_______________________________
Is this the real reason you didn't come to the Model?