Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 06-13-2006, 01:12 PM Working out averages
mad_willsy's Avatar
Super Spam Talker

Latest Blog Post:
R&R Catering Hire Testimonial
Posts: 805
Name: Will Craig
Location: Cheltenham, Gloucestershire, UK
Trades: 0
I have started myself a little project, a Deal Or No Deal PHP game.

Below is a list of variables i need to use to work out average, i will then use the average to work out bankers offer:
PHP Code:
$row mysql_fetch_row($result);
$box1 "$row[1]"
$box2 "$row[2]"
$box3 "$row[13]"
$box4 "$row[14]"
$box5 "$row[15]"
$box6 "$row[16]"
$box7 "$row[17]"
$box8 "$row[18]";
$box9 "$row[19]"
$box10 "$row[3]"
$box11 "$row[4]";
$box12 "$row[5]"
$box13 "$row[6]"
$box14 "$row[7]"
$box15 "$row[8]"
$box16 "$row[9]"
$box17 "$row[10]"
$box18 "$row[11]"
$box19 "$row[12]"
$box20 "$row[20]"
$box21 "$row[21]"
$box22 "$row[22]"
$picked1 "$row[23]"
$picked2 "$row[24]"
$picked3 "$row[25]"
$picked4 "$row[26]"
$picked5 "$row[27]"
$picked6 "$row[28]"
$picked7 "$row[29]"
$picked8 "$row[30]"
$picked9 "$row[31]"
$picked10 "$row[32]"
$picked11 "$row[33]"
$picked12 "$row[34]"
$picked13 "$row[35]"
$picked14 "$row[36]"
$picked15 "$row[37]"
$picked16 "$row[38]"
$picked17 "$row[39]"
$picked18 "$row[40]"
$picked19 "$row[41]"
$picked20 "$row[42]"
$picked21 "$row[43]"
$picked22 "$row[44]";
$player "$row[45]";
$onbox "$row[46]"
$player is the players box number
$box# is the amount of money in that box
When $picked# = 1 then the user has picked that box number.

I will simplify this to 3 boxes:

$box1 = 0.01
$picked1 = 1
$box2 = 0.10
$picked2 = 0
$box3 = 0.50
$picked3 = 0
$player = 3

I want to add up the unpicked (where $picked# = 0) box values ($box#) then divide by the number of unpicked boxes.
__________________
Wont :P

Please login or register to view this content. Registration is FREE
mad_willsy is offline
Reply With Quote
View Public Profile Visit mad_willsy's homepage!
 
 
Register now for full access!
Old 06-13-2006, 01:51 PM Re: Working out averages
stOx's Avatar
Machine

Latest Blog Post:
Worlds Smallest Car - Peel P50
Posts: 2,111
Name: Matt. (>',')>
Location: London, England.
Trades: 0
PHP Operators should be able to do it.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
stOx is offline
Reply With Quote
View Public Profile Visit stOx's homepage!
 
Reply     « Reply to Working out averages
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.12695 seconds with 12 queries