php mysql golf stats page -


i creating site tracks golf scores , gives them user. each round, player puts in score , want show how many pars, birdies, bogies, etc. player had. each course has hole's par value in there. need take player's score, figure out if -1, 0, +1, +2, etc. par value. after that, need figure out how many birdies, pars, bogies, etc. there entire round, , list them out on table.

does know way this? have been sitting here pondering on time now, , can't think of how this.

below query:

$user = $_get['user_id'];  $get_player = "select *           users           user_id = '$user'"; $run_player = mysqli_query($con, $get_player);  $row_player = mysqli_fetch_array($run_player);  $get_rounds = "select *                user_rounds                inner join courses                 on user_rounds.course_name=courses.course_name                user_id = '".$row_player['user_id']."'"; $run_rounds = mysqli_query($con, $get_rounds); while($row_rounds = mysqli_fetch_array($run_rounds)) { 

and here trying math of this. tables have each of scores stored along name of course played; 2 tables matching fine.

any appreciated!!

edit

below db structure:

rounds  create table if not exists `user_rounds` ( `round_id` int(100) not null auto_increment, `user_id` int(100) not null, `date_played` date not null, `user_name` varchar(100) not null, `user_last_name` varchar(100) not null, `user_username` varchar(100) not null, `user_pass` varchar(100) not null, `user_email` varchar(100) not null, `course_name` varchar(100) not null, `tee_played` varchar(100) not null, `cor_rating` varchar(100) not null, `cor_slope` int(100) not null, `hole1` int(5) not null, `hole2` int(5) not null, `hole3` int(5) not null, `hole4` int(5) not null, `hole5` int(5) not null, `hole6` int(5) not null, `hole7` int(5) not null, `hole8` int(5) not null, `hole9` int(5) not null, `hole10` int(5) not null, `hole11` int(5) not null, `hole12` int(5) not null, `hole13` int(5) not null, `hole14` int(5) not null, `hole15` int(5) not null, `hole16` int(5) not null, `hole17` int(5) not null, `hole18` int(5) not null, `totout` int(10) not null, `totin` int(10) not null, `total` int(10) not null,  courses  create table if not exists `courses` ( `course_id` int(10) not null auto_increment, `c_id` varchar(10) not null, `course_name` varchar(50) not null, `hole_1_par` varchar(1) not null, `hole_2_par` varchar(1) not null, `hole_3_par` varchar(1) not null, `hole_4_par` varchar(1) not null, `hole_5_par` varchar(1) not null, `hole_6_par` varchar(1) not null, `hole_7_par` varchar(1) not null, `hole_8_par` varchar(1) not null, `hole_9_par` varchar(1) not null, `hole_10_par` varchar(1) not null, `hole_11_par` varchar(1) not null, `hole_12_par` varchar(1) not null, `hole_13_par` varchar(1) not null, `hole_14_par` varchar(1) not null, `hole_15_par` varchar(1) not null, `hole_16_par` varchar(1) not null, `hole_17_par` varchar(1) not null, `hole_18_par` varchar(1) not null, `hole_1_hc_mens` varchar(2) not null, `hole_2_hc_mens` varchar(2) not null, `hole_3_hc_mens` varchar(2) not null, `hole_4_hc_mens` varchar(2) not null, `hole_5_hc_mens` varchar(2) not null, `hole_6_hc_mens` varchar(2) not null, `hole_7_hc_mens` varchar(2) not null, `hole_8_hc_mens` varchar(2) not null, `hole_9_hc_mens` varchar(2) not null, `hole_10_hc_mens` varchar(2) not null, `hole_11_hc_mens` varchar(2) not null, `hole_12_hc_mens` varchar(2) not null, `hole_13_hc_mens` varchar(2) not null, `hole_14_hc_mens` varchar(2) not null, `hole_15_hc_mens` varchar(2) not null, `hole_16_hc_mens` varchar(2) not null, `hole_17_hc_mens` varchar(2) not null, `hole_18_hc_mens` varchar(2) not null, `hole_1_hc_womens` varchar(2) not null, `hole_2_hc_womens` varchar(2) not null, `hole_3_hc_womens` varchar(2) not null, `hole_4_hc_womens` varchar(2) not null, `hole_5_hc_womens` varchar(2) not null, `hole_6_hc_womens` varchar(2) not null, `hole_7_hc_womens` varchar(2) not null, `hole_8_hc_womens` varchar(2) not null, `hole_9_hc_womens` varchar(2) not null, `hole_10_hc_womens` varchar(2) not null, `hole_11_hc_womens` varchar(2) not null, `hole_12_hc_womens` varchar(2) not null, `hole_13_hc_womens` varchar(2) not null, `hole_14_hc_womens` varchar(2) not null, `hole_15_hc_womens` varchar(2) not null, `hole_16_hc_womens` varchar(2) not null, `hole_17_hc_womens` varchar(2) not null, `hole_18_hc_womens` varchar(2) not null, 

so first 1 birdie, etc. i'm looking being able of pars, birdies, bogies, etc. , put them on of rounds have been played.


Comments

Popular posts from this blog

java - pagination of xlsx file to XSSFworkbook using apache POI -

Unlimited choices in BASH case statement -

apache - How do I stop my index.php being run twice for every user -