Hi everyone.
I`m looking to solve an issue.
My problem is :
i have more tables, but in my example will be only 3 with 2 columns:
users (id,nick)
comm (id,userID,text)
rev (id,userID,text)
So , i need to count the comm and the rev that users make, multiiply by a number and then sort the result
An comm values x points, an rev values y points, so i need to count the result and them sum then.
Example : user 1 has 2 comm and 3 rev, points = 2*x, 3*y.

It`s a way to calculate what user posted on the site. It wasn`t a problem untul i need a top 10 of users. For each users alone i used more queryes and calculate in php.
I don`t know if it can be done from the query alone,...
In the final i need $n and $n or something simple just a Count , $n $n ....
I hope u`ll understand the problem and my english :)

Recommended Answers

All 4 Replies

tx but that doesn`t help me, this is more complicate.

Member Avatar for iamthwee

tx but that doesn`t help me, this is more complicate.

Of course it is, you'll have to use joins and whatnot on your tables. I thought you didn't know how to do a top ten select so I gave you a link.

You can use that to apply it to your problem.

where is the count, the top 10 reffers at the final points, after the * , ..read the formulas ...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.