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 Pages<123>
Options
Go to last post Go to first unread
Offline Zero2Cool  
#11 Posted : Friday, October 22, 2010 3:56:11 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,502
Applause Received: 4,048
In the posts table, I have 13,155 posts.
The software shows 12,989.

I have 166 posts that were deleted, but not removed from the database??

Edit, actually it means I have 13,155 post ID's, but only 12,989 posts with a text.
Offline Zero2Cool  
#12 Posted : Friday, October 22, 2010 4:11:55 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,502
Applause Received: 4,048
[php]
SELECT _fpro_posts_text.post_id
FROM _fpro_posts, _fpro_posts_text
WHERE _fpro_posts.poster_id='2'
AND _fpro_posts_text.post_id != _fpro_posts.post_id
[/php]

Shouldn't this display a list of posts_text.post_id's that do not have a corresponding posts.posts_id for the poster_id 2?
Offline Zero2Cool  
#13 Posted : Friday, October 22, 2010 4:33:07 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,502
Applause Received: 4,048
This is hopeless. There's a ton of NULL's under id 2, okay, 136 or so, but I can't delete them records!
Offline djcubez  
#14 Posted : Friday, October 22, 2010 9:47:14 PM(UTC)
Rank: Senior Member

FleaFlicker Fantasy Football - Gold: 2014

Joined: 8/7/2008(UTC)
Location: Madison
Applause Given: 11
Applause Received: 17
From what you say this forum software works like other forum software with a POSTS table, a MEMBERS/USERS table and a TOPICS table. Each of them refer to each other by an auto-incremented value (topicID, postID and memberID). If you want to delete all the posts from members that don't exist you'd have to use multiple queries. For example:

Code:

&lt;?php

// establish variables
$memberposts = "0";
$nonmemberposts = "0";

// first query all posts
$post_query ="SELECT * FROM posts";
$post_result = mysql_query($post_query);
while($post_row = mysql_fetch_array($post_result)) {
	// now we can address each post individually
	// we should set some variables we need
	$postID = $post_row["id"];				// The post ID
	$memberID = $post_row["memberid"];		// The member that made this post
	$isMember = true;						// boolean for whether the member exists or not
	// now we need to figure out if the member with that id still exists
	// to do that you need to do a num_rows query
	$member_query = "SELECT * FROM members WHERE id='$memberID'";
	$member_count = mysql_num_rows($member_query);
	// check if it returns a result
	if($member_count &lt; "1") {
		// the member does not exist
		$isMember = false;
	}
	// now we return the result of our script
	if($isMember) {
		// post verified
		$memberposts++;
	} else {
		// delete the post?
		// I wouldn't
		// $delete_query = "DELETE FROM posts WHERE id='$postID'";
		// mysql_query($delete_query);
		$nonmemberposts++;	
	}
}

// display a report at the end
echo "Total posts by members: " . $membersposts . "&lt;br /&gt;total posts by non-members: " . $nonmemberposts;

?>


Obviously you'll have to replace the references I make to mysql rows and tables because I don't know whats yours are exactly. But if I do understand what you want this code should work, although I haven't tested it.

EDIT: Please don't run the script with the delete query in it until you've verified that it works. I would not want you to accidentally delete all the posts in this forum because of my bad code. I've already commented the delete query out so that if you want to you can just comment it back in.
Offline Zero2Cool  
#15 Posted : Friday, October 22, 2010 10:48:33 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,502
Applause Received: 4,048
Yeah, I don't want to delete them just yet. I want to see them first, that's why I was using the SQL query in the phpAdmin.

I can provide the three tables for you guys if that'll help.
Offline dhpackr  
#16 Posted : Friday, October 22, 2010 10:53:44 PM(UTC)
Rank: Registered

Joined: 12/12/2007(UTC)
Applause Given: 36
Applause Received: 36
Code:

&lt;?php

// $delete_query = "DELETE ?????FROM posts WHERE id='$postID'";
		// mysql_query($delete_query);
		$nonmemberposts++;	
?&gt;


wouldn't work if it wasn't commented out, this would cause an error, not telling what you want to delete.

why don't you just delete id #2, the whole row? if you are using auto increment for the id field, it wouldn't let you delete the row unless you delete the id
Offline Zero2Cool  
#17 Posted : Friday, October 22, 2010 10:58:03 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,502
Applause Received: 4,048
I've deleted members in the users table, but not their posts. Therefore there's posts out there that cause errors while searching.
Offline dhpackr  
#18 Posted : Friday, October 22, 2010 11:23:58 PM(UTC)
Rank: Registered

Joined: 12/12/2007(UTC)
Applause Given: 36
Applause Received: 36
imo, the best way to maintain your site would be to manually go into the database through php admin and delete the rows that way.

a script would be nice for maintenance, but you are risking wiping out data you want to keep.

just wondering, did you join the mysql forum. you should, and post questions in the forum.

you'll get your solution...if you are driven.

BTW..I find it humorous, a .NET Developer is running his forum using PHP, Microsoft's main nemesis.

Isn't that like sayin you work at Ford but drive a Toyota?

:icon_smile: just sayin!
Offline Zero2Cool  
#19 Posted : Saturday, October 23, 2010 12:08:55 AM(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,502
Applause Received: 4,048
I was looking into developing my own software using ASP-MVC2 with SQL Server, but it seems like too much work. I'd be reinventing a lot of the options here.

Might as well stick with this and enhance it, instead of recreating everything, right?
Offline dhpackr  
#20 Posted : Saturday, October 23, 2010 2:55:39 AM(UTC)
Rank: Registered

Joined: 12/12/2007(UTC)
Applause Given: 36
Applause Received: 36
yes, stick with the PHP site. Classic ASP is an old technology. You have to write a ridiculous amount of "spaghetti" code to do even a simple database call.

Microsoft updated to .NET for a reason!
Rss Feed 
Users browsing this topic
Guest (2)
3 Pages<123>
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 (1m) : Had it been other way around I would've been screaming and so would u.
uffda udfa (26m) : It's just true. I try hard to see it and tell it like it is. Was OPI.
Zero2Cool (2h) : which is of course ok, i just personally see it as weird.
Zero2Cool (3h) : Just odd that a Packers fan points out when Packers perceived to get away with something, yet ignore opponent. Weird.
Zero2Cool (3h) : Packers added RB Christine Michael (back) to the injury report as questionable
uffda udfa (3h) : Not diminishing anything. He got away with OPI. Didn't notice before. Was in airport.
Zero2Cool (5h) : Bahahahahahahha GO PACK GO!!!!
Zero2Cool (5h) : when you're buying your Super Bowl LI Champion gear, be critical of that too!
Zero2Cool (5h) : keep trying to diminish what the Packers have done and ...
Zero2Cool (5h) : one... that's just how it goes. They let the players play. But go ahead
Zero2Cool (5h) : Everyone knows on the hail mary type passes, those little shoves won't be called. Think replacement refs 2012. So, no did not get away with
Dulak (6h) : ya I think they mentioned that U U ... but you see this alot - even in the dallas game they pushed off at least 1 time (they as in dallas)
uffda udfa (12h) : Just rewatched Cobbs hail mary catch in slo mo...he should've been flagged for OPI. Got away with one.
uffda udfa (14h) : Nope. I like Gus.
beast (15h) : Did you want Anthony Lynn as HC? Cushion Bradley was going to follow Lynn where ever.
uffda udfa (16h) : Gus Bradley is new DC in SD/LA. I would've loved to had him here in Green Bay.
uffda udfa (20h) : It's just fine.
musccy (20h) : 5 questionable Packers, none for Falcons. Not good.
uffda udfa (20h) : Jordy not listed as OUT or DOUBTFUL. Questionable on injury report.
uffda udfa (21h) : This is the 6th straight game we've faced someone for the 2nd time. We learn.
uffda udfa (21h) : Aaron: I like our role. I like our chances. (said he relishes being an underdog)
uffda udfa (21h) : Aaron alludes to fake crowd noise at Georgia Dome for Sunday.
uffda udfa (22h) : So, to recap. Losing streak "just the way it is", winning streak "astronomical feat". #Balanced
uffda udfa (22h) : Ironically, he called the turn around "astronomical" not just the way it is in the NFL. #Don'tMissTheIrony
uffda udfa (22h) : Ted tells Demovsky the Packers weren't underachieving when 4-6. Just the way it is in the NFL????
Zero2Cool (20-Jan) : Only time I recall getting annoyed is when they beat a single topic over and over and over.
Pack93z (20-Jan) : Most yes... Heller seems to get it more so... diversity in his coverage... but seemingly can highlight the pressing issues properly.
Zero2Cool (20-Jan) : I'm kind of in the boat that they all are babblying boonies.
Pack93z (20-Jan) : God bless it... Bill Michaels can be a stubborn SOB at times... love his Packers coverage, still think he is a buffoon at times.
Zero2Cool (20-Jan) : Jordy Nelson Named PFWA Comeback Player of the Year
Zero2Cool (20-Jan) : Carter is predicitng the end is in ATL for Packers.
Porforis (20-Jan) : Or I could just completely miss the part where that was Cris Carter.
Porforis (20-Jan) : Careful there. Don't you want to predict a Packers loss just in case?
Zero2Cool (20-Jan) : @criscarter80 :Every fairy tale comes to an end, and this is where the magic carpet ride stops in the ATL.
Zero2Cool (20-Jan) : McCarthy: "JC Tretter actually had surgery Tuesday. He won't be available this week"
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
7m / Green Bay Packers Talk / hardrocker950

13m / Green Bay Packers Talk / mi_keys

18m / Green Bay Packers Talk / uffda udfa

51m / Green Bay Packers Talk / buckeyepackfan

4h / Green Bay Packers Talk / wpr

11h / Green Bay Packers Talk / beast

14h / Green Bay Packers Talk / beast

18h / Green Bay Packers Talk / luigis

18h / Green Bay Packers Talk / uffda udfa

20h / Green Bay Packers Talk / beast

20h / Green Bay Packers Talk / beast

21h / Green Bay Packers Talk / The_Green_Ninja

23h / Green Bay Packers Talk / uffda udfa

23h / Green Bay Packers Talk / sschind

20-Jan / Green Bay Packers Talk / DoddPower


Packers Headlines