Jump to content

darbyp

Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by darbyp

  1. hi, i have finally got my database set up for club timetrial results. I have got the first round results being pulled out of the database like this array(6) { ["round_num"]=> string(1) "1" ["round_date"]=> string(10) "2015-04-15" ["rider_firstname"]=> string(4) "firstname" ["rider_lastname"]=> string(10) "lastname" ["club_name"]=> string(14) "clubname" ["rider_time"]=> string( "00:22:03" } array(6) { ["round_num"]=> string(1) "1" ["round_date"]=> string(10) "2015-04-15" ["rider_firstname"]=> string(4) "firstname" ["rider_lastname"]=> string(7) "lastname" ["club_name"]=> string(9) "clubname" ["rider_time"]=> string( "00:22:11" } array(6) { ["round_num"]=> string(1) "1" ["round_date"]=> string(10) "2015-04-15" ["rider_firstname"]=> string(5) "firstname" ["rider_lastname"]=> string(7) "lastname" ["club_name"]=> string(14) "clubname" ["rider_time"]=> string( "00:22:21" } from a while($result = mysqli_fetch_assoc($query)) (if that is the best way of doing it) Is there anyway of looping through them and assigning a position i.e. 1, 2 ,3, 4 etc and account for people who finish with the same time so will have to be the same number but then skip a few to get back on track? Hope it makes sense Thanks
  2. the code shouldn't change but the data in the array. it will be "18/05/2015" with "name","club","time" "10/05/2015" with "name",club","time" etc etc if that helps? might be shooting the dark here and will have to just start making a database
  3. From the race results I am manually putting them in the array. So one week there could be 50 people next week could be 12. They will always be "name","club","time" but the date of the race will always be different
  4. Pretty much I want my results array to be... "date of race" => "ridername","club","time" . "ridername","club","time" . "ridername","club","time" But this on multiple dates and different clubs. I was hoping there would be away of going down the list of each dates and when it sees the first person from my club give them 20, second 19 etc etc but then start on the next date. And calculate it similar to the top? This possible? Thanks
  5. Only the highest 8 because the cycling club hold a race every Wednesday and 20 points goes to the fast club rider all the way down to 1. The maximum points is 160 so it is based off the 8 best races if two riders on 160 then fastest time . Now to merge both arrays or link somehow to pull in fastest time. Defo past my experience but guess I can find out
  6. thank you so much! I had to working but it looked so ugly.. Just there has learnt me a lot! might fall into another problem in a few minute haha (with another issue)
  7. also if possible if the value is over 0 then add onto a variable called $totalRides
  8. Hello all, Just wondering if someone could help me. my array looks like this: "riderName" => "Example Rider", "round1" => "20", "round2" => "17", "round3" => "18", "round4" => "19", "round5" => "16", "round6" => "20", "round7" => "18", "round8" => "10", "round9" => "17", ... "round22" => "18", is there anyway i can loop through the rounds and get the 8 highest values and add them together to a variable? Thank you
  9. thank you both for your help. Been trying to get my head around it. Works really nicely now Thanks again
  10. i have gotten some code which will go through a directory and sub directory and get the image files then echo them into html code. I want 16 random images to be displayed (random on page refresh) the code i have do far <?php $di = new RecursiveDirectoryIterator('images'); foreach (new RecursiveIteratorIterator($di) as $filename => $file) { if (substr($file, -1) != ".") { echo '<div class="four columns"><img src="'. $file . '" style="width:100%; height=auto;"/></div>'; }; }; ?> How would I incorperate to get the random 16 images? like say i have 35 pictures within a directory? Thank you
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.