![]() |
![]() |
![]() |
||||
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. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
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 ;) |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
making it rain
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 ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 | |
making it rain
Industry Role:
Join Date: Oct 2003
Location: seattle
Posts: 22,119
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 |
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. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
<&(©¿©)&>
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 | |
Confirmed User
Join Date: Aug 2002
Location: The Netherlands, Rotterdam
Posts: 8,965
|
Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
♥ ♦ ♣ ♠
Industry Role:
Join Date: Sep 2002
Posts: 10,592
|
PHP Code:
__________________
![]() ![]() ![]() "I'm selflessly supporting the common good, but only coincidentally looking out for No.1." |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#10 | |
Confirmed User
Join Date: Aug 2003
Posts: 1,798
|
Quote:
__________________
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. |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#11 |
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 ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#12 |
Confirmed User
Industry Role:
Join Date: Mar 2002
Posts: 8,234
|
ooops! i was using "uid" instead of "userid". ;) it works now....
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#13 |
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. ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#14 |
Confirmed User
Join Date: Apr 2002
Location: Houston
Posts: 5,651
|
(35 * 15 + 50 * 10 + 80 * 8) / 3
thats a formula? |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#15 |
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 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#16 |
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) |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#17 | |
Confirmed User
Join Date: Feb 2003
Location: Canby, OR
Posts: 7,453
|
Quote:
![]() 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) |
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#18 |
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 ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |