Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MYSQL


SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





Groups For Members


My client wants GROUPS for his members, what I am thinking is creating a table for each group - since each group has a leader ID number and member list.

Would this be a good way to do it?.




View Complete Forum Thread with Replies

Related Forum Messages:
Query To Select Only Groups That Have More Than 3 Members
I need one query that selects items from table that have 3 or more associated rows in another table.

Eg. You may have a table of products and a table of product reviews. How would you select only the products that have 3 or more reviews?

View Replies !
Groups
I have:
col1col2
item13
item15
item27
item23
item14
item34

I'm looking for the result:
col1col2
item15
item27
item34

--the highest col2 value for data paired with col1
--no duplicates in col1
--order does not matter for either col1 or col2 in the result

The SQL I have now is:
select col1, col2 from table1 group by col1

I'm not sure how to force it to group col1 using the highest value from
col2. Also, I am on MySQL 4.0 so subqueries are out. I'm not sure if
this is relevant, but table1 is made by joining two other tables
together (one of which is a heap).

View Replies !
Group Of Groups
Basically, I have a simple group query...
SELECT `StudentID`, COUNT(*) FROM `StudentHistoryT` GROUP BY `StudentID`

The query returns the number of records for each student.

What I want is a query that produces a count of the number of students with a distinct number of records, that is, I want to group by COUNT(*) and return the COUNT(*) of the new group.

My nieve atmysqlt...
SELECT `StudentID`, COUNT(*) FROM `StudentHistoryT` GROUP BY `StudentID` GROUP BY COUNT(*)

View Replies !
Find Members
I have 3 tables: members, groups, and group_converge. Members contains a userid and some information I need, groups contains the groupid and name, and group_converge tells me which members are in which groups using a memberid and a groupid.
I'm trying to generate a list of people who are able to be put in X group. I can do this using a loop, by first getting a list of members, then checking which ones are in the group and eliminating them, but that involves more queries than I want to use. I know there's a way to narrow this down to one query.

View Replies !
Tables For Members
Should i use a table for each of the first letter of there username
27 for alphas and 1 table for numeric or just use one table for the usernames?

View Replies !
Trying To Create A Top Ten Members
I have created my own forum but wish to have a top ten list of members who have posted the most on my home page.

i have a field called 'username' which i want to count and then work out which member shows the most and then have it shown first then each in turn to the one who has posted the least till i have either all members shown if less then ten or just the first ten.

can this be done using mysql coding or would i have to use the 'username' from the members signup database table and find each member in turn and count the number of posts made and then sort this list to get the list i need?

View Replies !
X Members Online
i am making a dynamic site which shows ..................
x guests online
y members online
total no:
i have made x guests online by tracking the distinct ip address but i am unable to make the how many members online.

View Replies !
IPB Members Combining
I have an old forum that I want to transfer the users over to my new forum which has 140 users theres about 200 more in th eold database, how would I go about combining the 2....so that it updates the user id etc

View Replies !
Group With Most Members?
The members of my site can create groups. I have sored them in the DB with the members id and the groups id. How can I find the group with the most members? In the case below I would like to return group_id 1.

id |userid |group_id |status |joindate
------------------------------------
1***|1****|1*******|1*****|1180472138
2***|1****|34******|1*****|1180710824
3***|59***|1*******|1*****|1180661614
4***|1****|33******|1*****|1180661614
5***|1****|25******|1*****|1180627931
6***|1****|24******|1*****|1180627804

CREATE TABLE `my_group` (
`id` int(10) unsigned NOT NULL auto_increment,
`userid` int(10) unsigned NOT NULL default Ɔ',
`group_id` smallint(6) NOT NULL default Ɔ',
`status` tinyint(1) unsigned NOT NULL default Ɔ',
`joindate` int(10) unsigned NOT NULL default Ɔ',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=27 ;

--
-- Dumping data for table `my_group`
--

INSERT INTO `my_group` VALUES (1, 1, 1, 1, 1180472138);
INSERT INTO `my_group` VALUES (25, 1, 34, 1, 1180710824);
INSERT INTO `my_group` VALUES (26, 59, 1, 1, 1180661614);
INSERT INTO `my_group` VALUES (24, 1, 33, 1, 1180661614);
INSERT INTO `my_group` VALUES (16, 1, 25, 1, 1180627931);
INSERT INTO `my_group` VALUES (15, 1, 24, 1, 1180627804);

View Replies !
Order By Giving Two Groups
I have a new database table which contains name and url field. When I order
by name I get two groups, the first being those without an entry in the url
field, the second with an entry in the url field, each grou seperately
ordered correctly.

In a possibly related problem with the same table displaying in a web
browser through php, there are again two groups diplaying when ordered by
name. If a member of the first group is displayed and resubmitted without
change, it then appears in the second group.

I tried doing an export / import to refresh the data, but it didn't help.

Any ideas for causes and or solutions?

View Replies !
Selecting Members, Mysql
I want to select the users from 'userTBL' which does not have any
property in 'live_properties' table, Both table has a same column
called 'username'

I have 2 tables called 'usersTBL' and 'live_properties'
user info stored in 'usersTBL' and their properties stored in
'live_properties'

View Replies !
Two Servers On Windows And My.cnf/my.ini Groups
I run two MySQL servers on Windows with the two services.
I read in the docs that it exists a way to identify the servers in my.cnf by
groups and about a tool from Linux to manage the groups.
How can I start a server on Windows through the my.cnf/my.ini 's groups?

View Replies !
Return Groups For Each Month
I would like to return monthly reports with a single query.For example:

January
15 Purchases
5 Refunds
6 Exchanges

February
20 Purchases
4 Refunds
2 Exchanges

The above data has about 60 records. The query has to group by month and then again by transaction type.

Here is what the record would look like
TransactionID - primary key
TransactionDate - Date
Transactiontype - integer

View Replies !
Counting And Ranking Within Groups
(commas are in place to show data seperation and are not needed in the result set)

Name Won
Julio, 2
julio, 3
julio, 0
Ron, 4
Ron, 2

and the results should be based upon wins sorted descending

Name Won Rank
Julio, 3, 1
julio, 2, 2
julio, 0, 3
Ron, 4, 1
Ron, 2, 2

View Replies !
Select First X -groups- Of Rows
What I've got is 3 tables: news, category, newscategory. newscategory is just a linker table, so the relationship is like this:

[news.newsid] <--> [newscategory.newsid][newscategory.categoryid] <--> [category.categoryid]


One entry in 'news' can be attached to many different categories via 'newscategory'.

What I want to do is return the first X news posts from 'news', along with all the categories that each post belongs to. I can't figure out how to do this: using an INNER JOIN there will be multiple rows for each news post as there will be multiple categories associated with each post, (one row per category per post) but the LIMIT 0, X clause will apply to all the rows,

View Replies !
How To Find Out Values Shared By Some Members
I have a table contains words extracted from documents which are belonging to a number of categories. Each category contains a number of documents. For each category, I want to find out those words which occur at least in N documents belonging to this category.

Code:....

View Replies !
Linking Two MySql Members Tables To = One
I have set up a forum as well as user auth into the heart of my site - however - I am still new to creating systems such as I have been working on and did not consider a repetitive user authentication system - I have two login forms - one for the forum on one database (in its own table) and one for the site itself on another database (in its own table) - Is there a way I can link the main site's user auth - to that of the forum auth and use only one members login and registration database for the whole site - instead of having multiple logins through out the site???

View Replies !
Using MySQL For A Simple List Of Members
I have a website which has an admin section which can easily be customised to insert things into the mySQL database, but i can't really use mySQL in the pages

What i need is a php script that can see how many entries there are for 'name', 'picture_url' and 'comment' (i have phpmyadmin but dont know what to insert so taht i can hold these values)

then the php script needs to insert each value for 'name', 'picture_url' and 'comment' into a seperate arrays

by that i mean

the array name_list may contan ('John', 'Fred')

View Replies !
Mysqld_multi Don't Starts Groups On Linux RedHat 9
mysqld_multi doesn't start the two groups if I gave this command imediately after stopping them.

View Replies !
Using A Single Sql Statement To Group And Count The Groups
I'm trying to count the total number of items in a table that are grouped e.g. my table is a shopping basket and is like this:

basketID||orderID||productID||quantity
1||1||2||1
2||1||3||1
3||1||4||1
4||2||2||1
5||2||4||1
6||3||4||1

so product 4 appears 3 times, product 2 appears twice and product 3 appears just once

how do use an sql statement (if it is possible) to group the products then list them in the order of which appears most

so i could say

SELECT * FROM basket GROUP BY productID;

and that would group them for me, but i want them listed like

productID
4
2
3

(as 4 has the most occurances, then 2, then 3)

View Replies !
Invision - Moving Members To Validating Table
I am using Invision 2.0.3 and i need help with a query which will move all the members from the members table to the validating table in the database. Reason i want to do it is so i can resend the activation email to all members so they have to reactivate their account.

I tried using this query:
UPDATE ibf_members SET mgroup = 1 WHERE mgroup = 3

This only moves their group and changes their permissions, it doesnt actaully put them into the validating table.

The validating group uses different fields than the members group so i dont know how to insert all my members into it.

View Replies !
Organizing Members By Votes (seperate Table)
Got another DB question for you... still getting the hang of more complex DB queries.

I have a table of:
MEMBERS: userid, username, password, etc.
VOTES: userid, voterid

Please note that the votes table can have multiple votes per user, etc. So what I want to do is, list my members in order of how many votes they have in the VOTES table.

View Replies !
Counting Members With 0 Posts And 0 Comments In My Blog
I really need help with a counting query, as my sql is a bit rusty...

I have a user table with thousands of users, most of which are spam signups that I want to get rid of. So I have decided that I will delete all users that have been registered for at least 3 months and have not posted or commented on anything in the blog. Users can have posts, since the blog accepts submissions, and you don't need to be a registered user to post comments either..

View Replies !
Total Members Joined Today, Yesterday, Etc
I have a field called regtime in my user table, when a user joins it enters time() into that field.

I want to code a page which loops the performance of new user registrations for the last 30 days.

I already coded this to show the people logged on in the last 24h:

PHP Code:

$24honQ = mysql_query("SELECT COUNT(id) FROM usertable WHERE lastactive>='".(time()-86400)."'");

What would be the best way to query this table for the "regtime" field, and code an output to show how many people registered on each day, for say 30 days

View Replies !
Access Rights For Some Users Ou Users Groups In Mysql's Clients
I'd like to know how to authorize some users or users's group created in mysql can logged only on some mysql's clients, with freeradius.

Mysql's tables are :

nas table for clients
radcheck table for users
radgropucheck table
usergroup table

View Replies !
Order Per "Group By" Groups
a table example:

Code:

ID | USER | VALUE |

1 | mike | 8
2 | mike | 10
3 |mike | 12
4 | john | 10
5 | john | 12
6 | john | 15

Desired result grouped by USER:

ID | USER | VALUE |
6 | john | 15
3 | mike | 12

as you can see, I'm ordering the group result by the last value of ID column for each user, then order by user name.

In other words, I need to retrieve the max ID value for each user. also order the result by user name.

How can I do that ?

Myabe there's no need of grouping,

View Replies !

Copyright © 2005-08 www.BigResource.com, All rights reserved