Green Bay Packers Forum

Welcome to your Green Bay Packers Online Community!

Since 2006, PackersHome has been providing a unique experience for fans.
Your participation is greatly anticipated!
Login or Register.
3 Pages123>
Options
Go to last post Go to first unread
Offline Zero2Cool  
#1 Posted : Friday, October 22, 2010 2:59:22 PM(UTC)
Rank: Premier Member

Yahoo! NCAA March Madness - Gold: 2015Yahoo! Fantasy Football - Gold: 2009FleaFlicker Fantasy Football - Silver: 2010Yahoo! NCAA March Madness - Silver: 2011ESPN NCAA March Madness - Bronze: 2010Yahoo! NCAA March Madness - Bronze: 2013

United States
Joined: 10/13/2006(UTC)
Location: Green Bay, WI
Applause Given: 2,351
Applause Received: 3,643
I'm trying to clean up the database.

My goal is to remove the posts from members that have been deleted.

I want a select statement that shows me how many of them there are before deleting.


I think I'll be using three tables with this.

table (field)
[ul]users (user_id)
posts (poster_id)
posts_text (post_id)[/ul]

Every post is given and id number. Then that id number is assigned to the post text.

The relationship between users and posts is the user_id and poster_id.
The relationship between posts and posts_text is the post_id.

I tried this, but it didn't work so well.

[php]SELECT *
FROM posts LEFT JOIN users
ON posts.poster_id != users.user_id[/php]


I think I caused some site load errors with this query too, lol.
Offline dhpackr  
#2 Posted : Friday, October 22, 2010 3:09:19 PM(UTC)
Rank: Registered

Joined: 12/12/2007(UTC)
Applause Given: 36
Applause Received: 36
bummer you can't delete posts
Offline dhpackr  
#3 Posted : Friday, October 22, 2010 3:17:12 PM(UTC)
Rank: Registered

Joined: 12/12/2007(UTC)
Applause Given: 36
Applause Received: 36
don't you want to use count

SELECT posts, COUNT(*) FROM posts WHERE Posterid=poster_id GROUP BY poster_id;

you have to play around with the table names, and you add quite a bit to a query with 'where' & 'group by' as well as 'orderby'

just running a select or count query should not break the site
Offline Zero2Cool  
#4 Posted : Friday, October 22, 2010 3:22:57 PM(UTC)
Rank: Premier Member

Yahoo! NCAA March Madness - Gold: 2015Yahoo! Fantasy Football - Gold: 2009FleaFlicker Fantasy Football - Silver: 2010Yahoo! NCAA March Madness - Silver: 2011ESPN NCAA March Madness - Bronze: 2010Yahoo! NCAA March Madness - Bronze: 2013

United States
Joined: 10/13/2006(UTC)
Location: Green Bay, WI
Applause Given: 2,351
Applause Received: 3,643
I dunno, do I?
Offline dhpackr  
#5 Posted : Friday, October 22, 2010 3:25:30 PM(UTC)
Rank: Registered

Joined: 12/12/2007(UTC)
Applause Given: 36
Applause Received: 36
you know the answer, just play around till you get the query.

wanna let me in?

i'll try
otherwise this will help
Offline Nonstopdrivel  
#6 Posted : Friday, October 22, 2010 3:31:11 PM(UTC)
Rank: Select Member

United States
Joined: 9/14/2008(UTC)
Location: Germany
Applause Given: 389
Applause Received: 263
I'm confused. Are you wanting to clean up deleted posts or posts by deleted members? The owner of the other board I used to administrate did the latter routinely; unfortunately, some of the most prolific members (e.g., instructors) were getting deleted. This resulted in some of our best threads being rendered nearly indecipherable, with members responding to phantom statements and questions. Threads came to resemble Swiss cheese, with much of the best content missing, rendering them all but useless. If this is what you want to do, I'd urge caution in implementing it.
Offline Zero2Cool  
#7 Posted : Friday, October 22, 2010 3:36:19 PM(UTC)
Rank: Premier Member

Yahoo! NCAA March Madness - Gold: 2015Yahoo! Fantasy Football - Gold: 2009FleaFlicker Fantasy Football - Silver: 2010Yahoo! NCAA March Madness - Silver: 2011ESPN NCAA March Madness - Bronze: 2010Yahoo! NCAA March Madness - Bronze: 2013

United States
Joined: 10/13/2006(UTC)
Location: Green Bay, WI
Applause Given: 2,351
Applause Received: 3,643
627 posts returned.


Every post should have a valid relationship to a member.
Every topic should have a valid relationship to a post.
Every post should have a valid relationship to a topic.

I don't want rogue data out there.
Offline Pack93z  
#8 Posted : Friday, October 22, 2010 3:44:48 PM(UTC)
Rank: Select Member

PackersHome NFL Pick'em - Bronze: 2012

United States
Joined: 3/16/2007(UTC)
Location: North Central Wisconsin
Applause Given: 435
Applause Received: 1,203
Yes use the count, cleaner approach for your request in the first post.. as a review.
Offline Pack93z  
#9 Posted : Friday, October 22, 2010 3:45:50 PM(UTC)
Rank: Select Member

PackersHome NFL Pick'em - Bronze: 2012

United States
Joined: 3/16/2007(UTC)
Location: North Central Wisconsin
Applause Given: 435
Applause Received: 1,203
Okay.. with the timeout error, more than likely due to query gen, my comment now seems out of place. lol.
Offline Zero2Cool  
#10 Posted : Friday, October 22, 2010 3:52:22 PM(UTC)
Rank: Premier Member

Yahoo! NCAA March Madness - Gold: 2015Yahoo! Fantasy Football - Gold: 2009FleaFlicker Fantasy Football - Silver: 2010Yahoo! NCAA March Madness - Silver: 2011ESPN NCAA March Madness - Bronze: 2010Yahoo! NCAA March Madness - Bronze: 2013

United States
Joined: 10/13/2006(UTC)
Location: Green Bay, WI
Applause Given: 2,351
Applause Received: 3,643
627 is what I got back, which is just a list of members who have 1 or more posts.

The member list shows 618 with a post.

That to me means we have posts for 9 members that have been deleted.
Rss Feed 
Users browsing this topic
Guest
3 Pages123>
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error


Fan Shout
Smokey (1h): \_/
Smokey (3h): WHAT ?
Smokey (3h): Hip Hip Hooray ! John Wilkes Booth shoots Abe Lincoln !
Zero2Cool (4h): lol seriously??
uffda udfa (4h): Vikes fans are talking about Johnny Football.
Cheesey (4h): Well...being on the Vikings alone could cause cursing and throwing helmets!
uffda udfa (4h): Achilles?
Smokey (4h): Teammates seen cursing and throwing helmets .
Smokey (4h): Bridgewater/non-contact injury to L. knee/leg .
Zero2Cool (5h): Whoa Teddy bridgewater just went down looks serious Vikings end practice
Zero2Cool (6h): HEY! It could be a 6th rounder that turns into four 7th rounder (aka Jeff Janis!)
uffda udfa (6h): We really needed a 2018 7th rounder. Will really help DL issue.
uffda udfa (6h): Yes it is. Didn't see that blockbuster coming. Glad we got what's needed.
Zero2Cool (6h): Some uffda udfa recently claimed Packers never trade. HA, jokes on that clown!!! Bahahahahahahahah
uffda udfa (7h): TT with trade. Lerentee McCray to Bills for 2018 draft choice. 2018?
uffda udfa (11h): Blackman officially waived. Perillo our 3rd TE and Randall starter opposite Shields.
uffda udfa (11h): Crockett, Blackman and Henry expected to be waived per Demovsky
uffda udfa (22h): Chargers cut our old friend, James Jones.
Zero2Cool (29-Aug): Packers release Peter Mortell.
Zero2Cool (29-Aug): Laser Gunns, why two accounts?
Zero2Cool (29-Aug): Patriots released DT Terrance Knighton
Zero2Cool (29-Aug): I'm glad you're back uffda. Keep it strong!
Zero2Cool (29-Aug): Cullen acknowledged he was wrong already. I guess I just dismiss bad blood on that fact.
Zero2Cool (29-Aug): Type F blood = bad blood bahahaha
uffda udfa (29-Aug): Definite bad blood. Cullen felt disrespect with no comm from TT at any point.
uffda udfa (29-Aug): Paul Kruger released by Browns. Cagy vet 3-4 DL we could use.
Zero2Cool (29-Aug): Bad blood? Hahhaha no!
Zero2Cool (29-Aug): Shallow to understand the Vikings aren't football? Lighten up buttercup!
uffda udfa (29-Aug): Cullen Jenkins working out for Skins. Should be for us. Bad blood there.
DoddPower (29-Aug): Fellow PackersHome members need you!
DoddPower (29-Aug): Opening in Pack Attack keeper league. Message me if you're interested.
Smokey (28-Aug): 3:30 PM Pizza Delivery !
Smokey (28-Aug): I'm not that shallow, I like all football games .
Zero2Cool (28-Aug): Shit I need to fix this shout so we can hit ENTER.
Zero2Cool (28-Aug): It was losing your arms or watch the game wasn't it?
Please sign in to use Fan Shout

Road To Super Bowl LI
Sunday, Sep 11 @ 12:00 PM
at Jaguars
Sunday, Sep 18 @ 7:30 PM
at Vikings
Sunday, Sep 25 @ 12:00 PM
LIONS
Sunday, Oct 2 @ 12:00 AM
BYE
Sunday, Oct 9 @ 7:30 PM
GIANTS
Sunday, Oct 16 @ 3:25 PM
COWBOYS
Thursday, Oct 20 @ 7:25 PM
BEARS
Sunday, Oct 30 @ 12:00 PM
at Falcons
Sunday, Nov 6 @ 3:25 PM
COLTS
Sunday, Nov 13 @ 12:00 PM
at Titans
Sunday, Nov 20 @ 7:30 PM
at Redskins
Monday, Nov 28 @ 7:30 PM
at Eagles
Sunday, Dec 4 @ 12:00 PM
TEXANS
Sunday, Dec 11 @ 3:25 PM
SEAHAWKS
Sunday, Dec 18 @ 12:00 PM
at Bears
Saturday, Dec 24 @ 12:00 PM
VIKINGS
Sunday, Jan 1 @ 12:00 PM
at Lions

Think About It
Think About It

Recent Topics
34m / Green Bay Packers Talk / yooperfan

49m / Green Bay Packers Talk / nerdmann

3h / Green Bay Packers Talk / uffda udfa

3h / Green Bay Packers Talk / sschind

4h / Green Bay Packers Talk / Cheesey

4h / Around The NFL / Cheesey

5h / Green Bay Packers Talk / luigis

6h / Green Bay Packers Talk / uffda udfa

6h / Green Bay Packers Talk / Barfarn

8h / Green Bay Packers Talk / RaiderPride

20h / Fantasy Sports Talk / Smokey

21h / Around The NFL / wpr

21h / Green Bay Packers Talk / Barfarn

21h / Green Bay Packers Talk / wpr

23h / Fantasy Sports Talk / Zero2Cool


Packers Headlines