So I want something like...
John Smith 32 submissions
Larry Hammill 12 submissions
Lisa Palm 46 submissions
is this possible?
This can be done using Connectivity, you will have to understand how it works first through, we have few tutorials on the FAQs page.
Regards,
Max
I used:
$user =& JFactory::getUser();
$userid=$user->id;
$result= mysql_query("SELECT DISTINCT name, COUNT(*) AS rowcount FROM Submissions GROUP BY cf_user_id");
$result_array=array();
while($row = mysql_fetch_assoc($result))
and this gives me a count of submissions for each user like this
Bob 27
Larry 19
Claire 14
Now I need to try to join the table that contains their last name "jos_userdata" using:
$user =& JFactory::getUser();
$userid=$user->id;
$result= mysql_query("SELECT *
FROM jos_users
JOIN jos_userdata ON jos_users.id = jos_userdata.cf_user_id");
$result_array=array();
while($row = mysql_fetch_assoc($result))
I got their last name now im stuck on how to get it to have the count as well like this....
Bob Jagger 27
Larry Smith 19
[Users] => Array
(
[id] => 65
[name] => George
[username] => gsmith
[email] => [email]my@email.com[/email]
[usertype] => Registered
[block] => 0
[sendEmail] => 0
[gid] => 18
[registerDate] => 2012-10-24 02:38:14
[lastvisitDate] => 2012-10-24 10:56:34
[activation] =>
[params] =>
)
[Profile] => Array
(
[cf_id] => 2
[cf_uid] => ***********
[cf_user_id] => 65
[last_name] => Smith
[phone] => 76768
[fax] => 78686
In Chrono Connectivity I only see the user names and everything else is blank...
Users.name,User.username,Profile.last_name
what am i doing wrong? Please help