GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Any Programmers Around Today? (https://gfy.com/showthread.php?t=922121)

Bama 08-16-2009 04:24 PM

Any Programmers Around Today?
 
I have a question and maybe one of you can help me.

What I want to do is find a customer record in a db.

I need x to be equal to or greater than 1000 and y to be equal to or greater than 95% of x and if so - delete the customer record written out in a php code.

Anyone help?

Sex9 08-16-2009 06:52 PM

Here is a tibit a code I used on one of my games
$x = 1000;
$y = 950;
$result = mysql_query ("SELECT * FROM $table WHERE x > '$x' && y > '$y' ORDER BY id DESC");
$nRows = mysql_num_rows($result);

for ($i=0; $i< $nRows; $i++){
$row = mysql_fetch_array($result);
$theid = $row['id'];
$query124 = "DELETE FROM $table WHERE id= '$theid'";
mysql_query($query124) or die;
}
I am self taught and make no guarantees, but that worked for me

Sex9 08-16-2009 07:13 PM

oops, just saw where you wanted y to always be 95% of x so I revised it a bit
$x = 1000;
$y = 950;
$result = mysql_query ("SELECT * FROM $table WHERE x > '$x' && y > '$y' ORDER BY id DESC");
$nRows = mysql_num_rows($result);

for ($i=0; $i< $nRows; $i++){
$row = mysql_fetch_array($result);
$theid = $row['id'];
$x2 = $row['x'];
$y2 = $row['y'];
if($y2 > ($x2 * .95)){
$query124 = "DELETE FROM $table WHERE id= '$theid'";
mysql_query($query124) or die;
}
}

Bama 08-16-2009 11:38 PM

Hey, thanks!

Bama 08-27-2009 06:48 PM

Acck - need a little revision to this if anyone else care's to help out! (changed variables and added 1)

I need:

x to be 500 OR GREATER
y to be 95% of X OR GREATER and IF
z is less than X - delete the record

but if

z is greater than X - disregard Y and keep the record

Anyone help?

woj 08-27-2009 07:21 PM

homework help? eh?

munki 08-27-2009 10:41 PM

PHP Code:

$evil 666;
$money sqrt($evil); //Money is the root of all evil
$time $money//Time is money
$women $time*$money//Women require time and money

if ($women == $evil) {echo 'Women are evil';}
if (
$women != $evil) {error_log('Thats fucking impossible, 0');} 


Bama 08-28-2009 09:36 AM

Quote:

Originally Posted by woj (Post 16244030)
homework help? eh?

LOL! No!

BestXXXPorn 08-28-2009 10:15 AM

I'll post something ... can you give actual field names and some sample values?

In fact you shouldn't even need PHP for this if you're trying to do what I think you are :P

BestXXXPorn 08-28-2009 10:22 AM

From what you wrote (where x, y, and z are field names):

DELETE FROM `table` WHERE x >= 500 AND y>=(x * 0.95) AND z < x;

Might want to run a

SELECT * FROM `table` WHERE x >= 500 AND y>=(x * 0.95) AND z < x;

first to make sure you've got all the correct data in there... and I recommend backing up the table first too :P

Bama 08-31-2009 09:02 PM

Fights Won: 100 Fights Lost: 543
Opponents Killed: 68 Deaths: 505
Jobs Completed: 6375

OK, this is dumb, but at the same time take a bit of thought so you don't delete an account that doesn't fall into the criteria that's intended.

There's this online game where you can attack - be attacked or do jobs (or a mixture of both). If you do the jobs, you lose stats boosting points making you weaker than other opponents so you'll die more (deaths).

When a weak opponent attacks a strong opponent and dies - the stronger gets the stats boost so we call those weak account "padders". Accounts whose only purpose is to "pad" stronger opponents stats. Those are the ones we want to find and delete.

The stats shown above is a good example because it's primarily a job doer account - but is used to pad now and then as well. You can tell that because the fights lost and the deaths are pretty darn close (within 95%).

To keep from eliminating it, you have to have a higher job than fight lost ratio so that it's kept. That's why I set the minimum fights lost at 1000 (above dog doesn't meet that criteria so it would be kept)

But, that isn't a perfect solution either because what if the stats looked like this:

Fights Won: 100 Fights Lost: 543
Opponents Killed: 68 Deaths: 505
Jobs Completed: 75

Now we'd know (because of the low job's completed number) that this account is used to pad with - but doesn't meet the 1000 minimum number set - so we'd be missing alot of accounts to delete).

How would you go about scooping up all the padders without deleting an account that does the jobs?

ProG 09-01-2009 01:42 AM

I have no idea if this will help - I couldn't fully understand what you need from reading your posts so it's a shot in the dark.

Code:

DELETE FROM `dogs` WHERE  (`losses` >= 1000 AND ( ( `deaths` / `losses` ) * 100 ) > 90 ) OR ( ( ( `deaths` / `losses` ) * 100 ) > 90 AND `jobs` < `losses` );
lol @ dog fighting game :upsidedow

Bama 09-01-2009 10:26 PM

Quote:

Originally Posted by ProG (Post 16260644)
I have no idea if this will help - I couldn't fully understand what you need from reading your posts so it's a shot in the dark.

Code:

DELETE FROM `dogs` WHERE  (`losses` >= 1000 AND ( ( `deaths` / `losses` ) * 100 ) > 90 ) OR ( ( ( `deaths` / `losses` ) * 100 ) > 90 AND `jobs` < `losses` );
lol @ dog fighting game :upsidedow

Hey now - it's a fun time passer late at night when everyone you'd need to talk to on the east coast is in bed - and thanks!


All times are GMT -7. The time now is 08:17 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123