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: 2011FleaFlicker Fantasy Football - Bronze: 2016ESPN NCAA March Madness - Bronze: 2010Yahoo! NCAA March Madness - Bronze: 2013

United States
Joined: 10/13/2006(UTC)
Location: Green Bay, WI
Applause Given: 2,501
Applause Received: 4,045
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: 2011FleaFlicker Fantasy Football - Bronze: 2016ESPN NCAA March Madness - Bronze: 2010Yahoo! NCAA March Madness - Bronze: 2013

United States
Joined: 10/13/2006(UTC)
Location: Green Bay, WI
Applause Given: 2,501
Applause Received: 4,045
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: Stratford, New Jersey
Applause Given: 406
Applause Received: 344
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: 2011FleaFlicker Fantasy Football - Bronze: 2016ESPN NCAA March Madness - Bronze: 2010Yahoo! NCAA March Madness - Bronze: 2013

United States
Joined: 10/13/2006(UTC)
Location: Green Bay, WI
Applause Given: 2,501
Applause Received: 4,045
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: 437
Applause Received: 1,233
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: 437
Applause Received: 1,233
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: 2011FleaFlicker Fantasy Football - Bronze: 2016ESPN NCAA March Madness - Bronze: 2010Yahoo! NCAA March Madness - Bronze: 2013

United States
Joined: 10/13/2006(UTC)
Location: Green Bay, WI
Applause Given: 2,501
Applause Received: 4,045
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
uffda udfa (1h) : Packers brass potentially leaving? Not worthy of discussing. Pressure Cooker? Never enough talk about them.
Zero2Cool (7h) : Put Quintorris in a pressure cooker.
uffda udfa (11h) : Back to football: Julio says he's going to play Sunday. Did NOT say he wouldn't be limited in the game.
uffda udfa (11h) : Anyone ever used their dishwasher to make their Thanksgiving turkey?
uffda udfa (11h) : Favorite Ronnie Milsap song? Smokey Mountain Rain or Any Day Now?
uffda udfa (14h) : Favorite GM candidate... Wolf or Gutekunst?
uffda udfa (15h) : I'd rather sit them than play them too compromised.
uffda udfa (15h) : Yeah, Z. More pressure cooker talk and smoked turkeys.
Zero2Cool (15h) : If this were a regular-season game, Nelson, Adams and Allison probably would not play, MM says.
Smokey (16h) : Mason Crosby is ill, hope it's not the Flu.
Smokey (16h) : Great, can we move past that story and get back to the Atlanta game ?
Zero2Cool (16h) : Packers exec Eliot Wolf has withdrawn his name for 49ers' GM job, as @TomPelissero reported. He didn't feel it was the right time.
TheKanataThrilla (17h) : We'll just have to score TDs then.
Zero2Cool (17h) : That's what we know.
Zero2Cool (17h) : Crosby, Mason K Illness
Smokey (18h) : Is He ill or not ?
Smokey (18h) : Raiderpride asked, "Anyone know what Crosby's illness is?"
Zero2Cool (18h) : Davante Adams expected to play- KFFL
Porforis (19h) : Alright, my opinion on Jordy has changed. If he's medically cleared to play, play him.
hardrocker950 (20h) : By Sunday we won't have any WRs
Zero2Cool (21h) : Geronimo hamstring, Janis quad. BEAUTIFUL.
Smokey (21h) : Mason Crosby, is his health OK ?
Smokey (21h) : Hello
FLORIDA PACKER88 (21h) : Davis, G-Mo, and Janis will need to step up, but all three did score last time we played ATL!
FLORIDA PACKER88 (21h) : Does Janis become a playoff hero second year in a row? Looks we're gonna have to find out either way regardless. Thank God for a healthy Cob
Smokey (21h) : Is Mason Crosby's health OK ?
Smokey (22h) : What's in your Coffee ?
uffda udfa (18-Jan) : Sit Davante if he has a bad ankle. We remember 2015.
uffda udfa (18-Jan) : Davante is not going to practice until SAT at earliest.
uffda udfa (18-Jan) : Davante and Jordy may be inactive at ATL.
Smokey (18-Jan) : ROFL !!
Cheesey (18-Jan) : The Packers SMOKED the COWBOYS!!!LOL!
Smokey (18-Jan) : Ever Smoke a Turkey, it takes lots of rolling papers. LOL
Smokey (18-Jan) : Thanks Cheesey. LOL
Cheesey (18-Jan) : Smokey, it was chicken gizzards (and hearts)!
Please sign in to use Fan Shout

2016 Packers Schedule
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 @ 3:25 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 @ 7:30 PM
at Lions

Think About It
Think About It

Recent Topics
1h / Green Bay Packers Talk / uffda udfa

1h / Green Bay Packers Talk / Dulak

1h / Green Bay Packers Talk / uffda udfa

1h / Green Bay Packers Talk / uffda udfa

4h / Green Bay Packers Talk / Rick12

6h / Green Bay Packers Talk / Zero2Cool

7h / Green Bay Packers Talk / Zero2Cool

11h / Green Bay Packers Talk / uffda udfa

12h / Green Bay Packers Talk / The_Green_Ninja

12h / Green Bay Packers Talk / Dulak

14h / Green Bay Packers Talk / TheKanataThrilla

14h / Around The NFL / wpr

14h / Around The NFL / wpr

15h / Green Bay Packers Talk / wpr

15h / Green Bay Packers Talk / Smokey


Packers Headlines