Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 02-17-2004, 01:01 AM   #1
galleryseek
Confirmed User
 
Industry Role:
Join Date: Mar 2002
Posts: 8,234
PHP / MySQL Help!

ok just a few questions, unfortunately my coder is a fatass lazy piece of shit so i'm attempting this, if you can prove helpful i'll use you on the project.. its just a big move to remove the current programmer cause this is such a big ass project... anyhow...

This is a table that I'm currently working with.


What I want to do is print out, "You have performed X amount of Exercises"... the initial coding i assume would go like this:

$query = "SELECT abrv FROM bgusers WHERE uid=$uid";
$result = mysql_query($query);

then how do you take the $result and exclude the duplicates then find out how many individual exercises there are after duplicates have been removed? i assume there is some kind of duplicate removing function in php...

I assume this isn't too difficult for most coders out there...

thx ;)
galleryseek is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 01:05 AM   #2
sixxxth_sense
So Fucking Banned
 
Join Date: Nov 2003
Location: T.O.
Posts: 2,430
I'm a coder and i'm 2 lazy to read the post!
So i'll give her a bump, it looks eazy
sixxxth_sense is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 01:05 AM   #3
fuzebox
making it rain
 
fuzebox's Avatar
 
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 22,119
Change your query...

$query = "SELECT abrv, count(*) AS total FROM bgusers WHERE uid=$uid" GROUP BY abrv;
$result = mysql_query($query);

Now when you mysql_fetch_array() or whatever your $result, you'll get a $result["abrv"] and a $result["total"] for each excercise.

Cheers
fuzebox is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 01:06 AM   #4
SMG
Confirmed User
 
Join Date: Aug 2003
Posts: 1,798
its faster if you just do it with the mysql using the distinct keyword
$query = "SELECT DISTINCT abrv, count(*) AS total FROM bgusers WHERE uid=$uid" GROUP BY abrv;
__________________
TGP Webmasters: sign up for the top 100 tgp list!
Submit galleries
If you add me to icq (title) make sure to mention GFY or I'll think you're a bot and deny you.
SMG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 01:10 AM   #5
fuzebox
making it rain
 
fuzebox's Avatar
 
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 22,119
Quote:
Originally posted by SMG
its faster if you just do it with the mysql using the distinct keyword
$query = "SELECT DISTINCT abrv, count(*) AS total FROM bgusers WHERE uid=$uid" GROUP BY abrv;
pfft
fuzebox is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 01:11 AM   #6
SMG
Confirmed User
 
Join Date: Aug 2003
Posts: 1,798
lol I pasted from the wrong post but I guess it still works, however that " at the end of the select line should be moved to the end of course...
__________________
TGP Webmasters: sign up for the top 100 tgp list!
Submit galleries
If you add me to icq (title) make sure to mention GFY or I'll think you're a bot and deny you.
SMG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 01:12 AM   #7
woj
<&(©¿©)&>
 
woj's Avatar
 
Industry Role:
Join Date: Jul 2002
Location: Chicago
Posts: 47,882
Is it just me or is that table really poorly designed?
__________________
Custom Software Development, email: woj#at#wojfun#.#com to discuss details or skype: wojl2000 or gchat: wojfun or telegram: wojl2000
Affiliate program tools: Hosted Galleries Manager Banner Manager Video Manager
Wordpress Affiliate Plugin Pic/Movie of the Day Fansign Generator Zip Manager
woj is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 01:14 AM   #8
johnbosh
Confirmed User
 
Join Date: Aug 2002
Location: The Netherlands, Rotterdam
Posts: 8,965
Quote:
Originally posted by woj
Is it just me or is that table really poorly designed?
not me
johnbosh is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 01:16 AM   #9
Voodoo
♥ ♦ ♣ ♠
 
Voodoo's Avatar
 
Industry Role:
Join Date: Sep 2002
Posts: 10,592
PHP Code:
function contactTechSupport$call "1-888-TECH-SUP";) if($mysql != "work"){  contactTechSupport(); } 
__________________

"I'm selflessly supporting the common good, but only coincidentally looking out for No.1."
Voodoo is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 01:18 AM   #10
SMG
Confirmed User
 
Join Date: Aug 2003
Posts: 1,798
Quote:
Originally posted by woj
Is it just me or is that table really poorly designed?
heh, I'd like to know whats up with that data column ... but then again maybe it doesnt require indexing ever on that so it might be fine
__________________
TGP Webmasters: sign up for the top 100 tgp list!
Submit galleries
If you add me to icq (title) make sure to mention GFY or I'll think you're a bot and deny you.
SMG is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 01:31 AM   #11
galleryseek
Confirmed User
 
Industry Role:
Join Date: Mar 2002
Posts: 8,234
thx for the help.. but im still having fucking problems...

$query = "SELECT DISTINCT abrv FROM bgexercises WHERE uid=$_SESSION[userid]";
$resultss3 = mysql_query($query);
$shit = mysql_num_rows($resultss3);
print "$shit";

and its not printing dick.

i didn't use all of your guys's coding cause i tried it and it didn't work.. all i'm trying to do is get how many different exercises there are n' thats it... god damn i hate this shit
galleryseek is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 01:34 AM   #12
galleryseek
Confirmed User
 
Industry Role:
Join Date: Mar 2002
Posts: 8,234
ooops! i was using "uid" instead of "userid". ;) it works now....
galleryseek is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 01:48 AM   #13
galleryseek
Confirmed User
 
Industry Role:
Join Date: Mar 2002
Posts: 8,234
okay.. heres the next one, its a lot more complex... i want to do something like this:

"You have GAINED STRENGTH on over 2 different exercises within the past MONTH "

this focuses specifically on the "data" field. we figure out the strength increase by this formula (using the first row from the picture up top):

(35 * 15 + 50 * 10 + 80 * 8) / 3

now what we'd have to do is somehow be able to group the strings according to ABRV, and compare "data" from 1 month ago of each exercise, to NOW... and determine if there has been a strength gain.. then print the results.

LOL, sounds like a bunch of shit.. thought i'd post it anyhow... if someone can get it right i'll paypal $30 if that'll raise incentive. if you're interested & need more specifics.. just post.
galleryseek is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 01:50 AM   #14
Alky
Confirmed User
 
Alky's Avatar
 
Join Date: Apr 2002
Location: Houston
Posts: 5,651
(35 * 15 + 50 * 10 + 80 * 8) / 3

thats a formula?
Alky is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 01:59 AM   #15
Mr. Porno King
Confirmed User
 
Join Date: Aug 2003
Posts: 146
Give me a bit more data on ICQ, and I'll write the code you need within the hour. 172884621
__________________
My Favorite Game
Mr. Porno King is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 02:03 AM   #16
JDog
Confirmed User
 
Join Date: Feb 2003
Location: Canby, OR
Posts: 7,453
If you want, contact me, I could help out with MYSQL/PHP. I've done the NSCash & ReelProfits affiliate area add-ons!

jDoG
__________________
NSCash now powering ReelProfits.com
ALSO FEATURING: NSCash.com :: SoloDollars.com :: ReelProfits.com :: BiminiBucks.com :: VOD
PROGRAMS COMING SOON: Greedy Bucks :: Vengeance Cash
NOW OFFERING OVER 60 SITES
CONTACT :: JAMES SMITH :: CHIEF TECHNOLOGY OFFICER :: ICQ (711385133)
JDog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 02:05 AM   #17
JDog
Confirmed User
 
Join Date: Feb 2003
Location: Canby, OR
Posts: 7,453
Quote:
Originally posted by woj
Is it just me or is that table really poorly designed?
Yea I think so too! I don't like the design, but hey! I don't have a say!

jDoG
__________________
NSCash now powering ReelProfits.com
ALSO FEATURING: NSCash.com :: SoloDollars.com :: ReelProfits.com :: BiminiBucks.com :: VOD
PROGRAMS COMING SOON: Greedy Bucks :: Vengeance Cash
NOW OFFERING OVER 60 SITES
CONTACT :: JAMES SMITH :: CHIEF TECHNOLOGY OFFICER :: ICQ (711385133)
JDog is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 02-17-2004, 08:54 AM   #18
Karlitos
Registered User
 
Join Date: Jul 2003
Location: Quebec city, Qc, Canada
Posts: 70
btw, it looks like PhpMyAdmin table when you get the result of a query!
__________________
__________________________
For all your web development needs, visit Progmatixxx.Com
Karlitos is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.