Jump to content

shaddf

Members
  • Posts

    102
  • Joined

  • Last visited

Everything posted by shaddf

  1. <div class="fix single_feature_right_add"> <div class="fix single_cat"> <img src="http://lorempixel.com/160/140" alt=""/> <div class="fix single_cat_meta"> <a>This is title from video</a> <div class="fix"> <p class="fleft">3 days ago</p> <p class="fright">7854 views</p> </div> </div> <div class="fix single_cat_rating"> <span>Ratings</span> <div class="single_cat_star"> <a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a> </div> </div><a href="/bfg.mp4"target="mvideo">hgfiy</a> </div> </div> <div class="fix single_feature_right_add"> <div class="fix single_cat"> <img src="http://lorempixel.com/160/140" alt=""/> <div class="fix single_cat_meta"> <a>This is title from video</a> <div class="fix"> <p class="fleft">3 days ago</p> <p class="fright">7854 views</p> </div> </div> <div class="fix single_cat_rating"> <span>Ratings</span> <div class="single_cat_star"> <a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a> </div> </div><a href="bbg.mp4"target="mvideo"><!--vimeo video--> <iframe width="610" height="490" src="bbg.mp4" frameborder="0" name="mvideo" allowfullscreen></iframe> <!--vimeo video--></a> </div> </div> <div class="fix single_feature_right_add"> <div class="fix single_cat"> <img src="http://lorempixel.com/160/140" alt=""/> <div class="fix single_cat_meta"> <a>This is title from video</a> <div class="fix"> <p class="fleft">3 days ago</p> <p class="fright">7854 views</p> </div> </div> <div class="fix single_cat_rating"> <span>Ratings</span> <div class="single_cat_star"> <a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a> </div> </div><a href="/bfg.mp4"target="mvideo">hgfiy</a> </div> </div> <div class="fix single_feature_right_add"> <div class="fix single_cat"> <img src="http://lorempixel.com/160/140" alt=""/> <div class="fix single_cat_meta"> <a>This is title from video</a> <div class="fix"> <p class="fleft">3 days ago</p> <p class="fright">7854 views</p> </div> </div> <div class="fix single_cat_rating"> <span>Ratings</span> <div class="single_cat_star"> <a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a> <a href=""></a> </div> </div><a href="bbg2.mp4"target="mvideo"><!--vimeo video--> <iframe width="610" height="490" src="bbg2.mp4" frameborder="0" name="mvideo" allowfullscreen></iframe> <!--vimeo video--></a> </div> </div> i have the code above.how can I make a video elent a link in a side bar such that when a user clicks it it shows in main iframe
  2. why not can you explain more please?
  3. Iam using prepared statements to do this. And when i prepare that answer of yours ,it does not work
  4. i have this table: MatchID | PlayerID | Goals -------------------------- 2 1 4 2 3 3 2 13 0 2 9 0 2 5 0 iam trying to get total using dynamic sql query like so: DECLARE TotalVariable INT; SET @l_sql_total=CONCAT(' SELECT SUM(x.Goals) into ',TotalVariable,' FROM a'); but iam getting an error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NULL' at line 1 And when I change to this: SET @l_sql_total=CONCAT(' SELECT SUM(x.Goals) into TotalVariable FROM a'); i get this error despite the fact that it has already been declared above: ERROR 1327 (42000): Undeclared variable: TotalVariable how can I clear this?
  5. they are already grouped by player_id.And when I try your idea it gives this: +-----------+----------+---------+ | player_id | PaddingR | marginR | +-----------+----------+---------+ | 1 | 100 | 0 | | 3 | 100 | 0 | +-----------+----------+---------+ 2 rows in set (0.09 sec) with no correct calculation. i expect to be getting this: +-----------+----------+---------+ | player_id | PaddingR | marginR | +-----------+----------+---------+ | 1 | 57 | 43 | | 3 | 43 | 57 | +-----------+----------+---------+ 2 rows in set (0.01 sec) i replaced with the total hard coded: SELECT x.player_id,round(x.Goals*100/7) as PaddingR,100-round(x.Goals*100/7) as marginR but this will keep changing I wonder why tjis is happening?
  6. why is it that when i try this : SELECT player_id,round(Goals *100/sum(Goals)) as PaddingR,100-round(Goals*100/sum(Goals)) as marginR from table it returns only one row and yet i see two in the table above
  7. i have this table: +-----------+-------+-------------------------+---------------------+ | player_id | Goals | gme | nem | +-----------+-------+-------------------------+---------------------+ | 1 | 4 | CRYSTAL SA Vs Sebowa FC | Sam Lukoye | | 3 | 3 | CRYSTAL SA Vs Sebowa FC | Mulan Babu | | 13 | 0 | CRYSTAL SA Vs Sebowa FC | Doughlas Doughlas | | 9 | 0 | CRYSTAL SA Vs Sebowa FC | Owori Clinton | | 5 | 0 | CRYSTAL SA Vs Sebowa FC | Zimbe Zimbe | | 16 | 0 | CRYSTAL SA Vs Sebowa FC | Jordan Jordan | | 12 | 0 | CRYSTAL SA Vs Sebowa FC | Muganda Moses | | 8 | 0 | CRYSTAL SA Vs Sebowa FC | Gilbert Gilbert | | 4 | 0 | CRYSTAL SA Vs Sebowa FC | Nandara Suda | | 15 | 0 | CRYSTAL SA Vs Sebowa FC | Mwase Mwase | | 11 | 0 | CRYSTAL SA Vs Sebowa FC | Wasswa Wasswa | | 7 | 0 | CRYSTAL SA Vs Sebowa FC | Faisal Faisal | | 18 | 0 | CRYSTAL SA Vs Sebowa FC | Ofwono Ofwono | | 14 | 0 | CRYSTAL SA Vs Sebowa FC | Balotelli Balotelli | | 10 | 0 | CRYSTAL SA Vs Sebowa FC | Ntwatwa Enoch | | 6 | 0 | CRYSTAL SA Vs Sebowa FC | Emma Emma | | 2 | 0 | CRYSTAL SA Vs Sebowa FC | Small Sam | | 17 | 0 | CRYSTAL SA Vs Sebowa FC | Wambululu Wambululu | +-----------+-------+-------------------------+---------------------+ 18 rows in set (0.00 sec) how can i get the total goals scored(7)? how can i get the percentage goals for each player that is perform a percentage calculation in the query to get them from table above?( for Sam :4/7*100)
  8. Ok then Also +---------+---------------+----------+------+-------------------------------+----------+---------------+-----------------------+ | MatchID | CompetitionID | SeasonID | Yr | Achievement | SeasonID | CompetitionID | CompetitionName | +---------+---------------+----------+------+-------------------------------+----------+---------------+-----------------------+ | 27 | 8 | 12 | 2016 | GO BACK TO SCHOOL Cup Winners | 12 | 8 | GO BACK TO SCHOOL Cup | | 29 | 8 | 12 | 2016 | GO BACK TO SCHOOL Cup Winners | 12 | 8 | GO BACK TO SCHOOL Cup | | 28 | 10 | 12 | 2016 | Kyanja U-14 Cup Winners | 12 | 10 | KYANJA U-14 Cup | | 27 | 8 | 12 | 2016 | GO BACK TO SCHOOL Cup Winners | 12 | 8 | GO BACK TO SCHOOL Cup | | 29 | 8 | 12 | 2016 | GO BACK TO SCHOOL Cup Winners | 12 | 8 | GO BACK TO SCHOOL Cup | +---------+---------------+----------+------+-------------------------------+----------+---------------+-----------------------+ 5 rows in set (0.00 sec) if i have other matches falling under a specific CompetitionID in same season this collection should come as one row with a count of 1/2 depending on season in which they are,how can I achieve this?
  9. Also +---------+---------------+----------+------+-------------------------------+----------+---------------+-----------------------+ | MatchID | CompetitionID | SeasonID | Yr | Achievement | SeasonID | CompetitionID | CompetitionName | +---------+---------------+----------+------+-------------------------------+----------+---------------+-----------------------+ | 27 | 8 | 12 | 2016 | GO BACK TO SCHOOL Cup Winners | 12 | 8 | GO BACK TO SCHOOL Cup | | 29 | 8 | 12 | 2016 | GO BACK TO SCHOOL Cup Winners | 12 | 8 | GO BACK TO SCHOOL Cup | | 28 | 10 | 12 | 2016 | Kyanja U-14 Cup Winners | 12 | 10 | KYANJA U-14 Cup | | 27 | 8 | 12 | 2016 | GO BACK TO SCHOOL Cup Winners | 12 | 8 | GO BACK TO SCHOOL Cup | | 29 | 8 | 12 | 2016 | GO BACK TO SCHOOL Cup Winners | 12 | 8 | GO BACK TO SCHOOL Cup | +---------+---------------+----------+------+-------------------------------+----------+---------------+-----------------------+ 5 rows in set (0.00 sec) And also if i have other matches falling under a specific CompetitionID in same season this collection should come as one row with a count of 1/2 depending on season in which they are
  10. +---------+---------------+----------+------+-------------------------------+----------+---------------+-----------------------+ | MatchID | CompetitionID | SeasonID | Yr | Achievement | SeasonID | CompetitionID | CompetitionName | +---------+---------------+----------+------+-------------------------------+----------+---------------+-----------------------+ | 27 | 8 | 12 | 2016 | GO BACK TO SCHOOL Cup Winners | 12 | 8 | GO BACK TO SCHOOL Cup | | 28 | 10 | 12 | 2016 | Kyanja U-14 Cup Winners | 12 | 10 | KYANJA U-14 Cup | | 27 | 8 | 12 | 2016 | GO BACK TO SCHOOL Cup Winners | 12 | 8 | GO BACK TO SCHOOL Cup | +---------+---------------+----------+------+-------------------------------+----------+---------------+-----------------------+ matchID 27 row has been repeated this should not be happeningfor the same season(it is like the match was played twice).
  11. i have this table A +---------+---------------+----------+ | MatchID | CompetitionID | SeasonID | +---------+---------------+----------+ | 27 | 8 | 12 | | 28 | 10 | 12 | +---------+---------------+----------+ 2 rows in set (0.00 sec) and this table B +------+-------------------------------+----------+---------------+------------------------+ | Yr | Achievement | SeasonID | CompetitionID | CompetitionName | +------+-------------------------------+----------+---------------+------------------------+ | 2016 | GO BACK TO SCHOOL Cup Winners | 12 | 8 | GO BACK TO SCHOOL Cup | | 2016 | UN Peace Cup Winners | 12 | 9 | UN Peace Cup | | 2016 | Kyanja U-14 Cup Winners | 12 | 10 | KYANJA U-14 Cup | | 2016 | NDIV V Winners | 12 | 7 | Nakawa Fifth division | | 2016 | GO BACK TO SCHOOL Cup Winners | 12 | 8 | GO BACK TO SCHOOL Cup | | 2015 | UN Peace Cup Winners | 13 | 9 | UN Peace Cup | | 2015 | Kyanja U-14 Cup Winners | 13 | 10 | KYANJA U-14 Cup | | 2015 | NDIV V Winners | 13 | 7 | Nakawa Fifth division | +------+-------------------------------+----------+---------------+------------------------+ 8 rows in set (0.02 sec) how can i select a competitionId from table B corresponding to a group of matches with same competitionID and seasonID in table A
  12. i have this table: +-----------+-----------+------+------------+-----------------------+-------+ | HomeScore | AwayScore | g_id | mo_th | g_date | venue | +-----------+-----------+------+------------+-----------------------+-------+ | 0 | 0 | 27 | July 2017 | Thu 13th of Jul 04.00 | H | | 0 | 0 | 26 | July 2017 | Sun 9th of Jul 04.00 | A | | 1 | 0 | 23 | June 2017 | Sun 18th of Jun 04.30 | H | | 1 | 1 | 19 | June 2017 | Sun 4th of Jun 04.30 | A | | 0 | 1 | 17 | May 2017 | Thu 25th of May 04.30 | H | | 1 | 0 | 15 | May 2017 | Sun 21st of May 04.30 | A | | 1 | 1 | 11 | May 2017 | Sun 14th of May 04.30 | H | +-----------+-----------+------+------------+-----------------------+-------+ 7 rows in set, 2 warnings (0.04 sec) I would like to loop through the records and display a heading of the mo_th field once before listing all the corresponding homescore ,away score and venue below it.Like so: MAY 2017 -HOMESCORE:0, AWAYSCORE:1 . . JUNE 2017 -HOMESCORE:1,AWAYSCORE:0 . . HOW CAN I DO THIS USING PHP
  13. i expect condition 3 call sp_get_ourclubresults_details('6','12','2','7','H'); to produce this +-----------+-----------+------+-----------+------------+------------+---------------+-------+ | HomeScore | AwayScore | g_id | mo_th | h_name | a_name | CompetitionID | venue | +-----------+-----------+------+-----------+------------+------------+---------------+-------+ | 1 | 1 | 11 | May 2017 | Sebfwa FC | PARK YARD | 7 | H | +-----------+-----------+------+-----------+------------+------------+---------------+-------+
  14. Ihave this sql: CREATE PROCEDURE sp_get_ourclubresults_details(IN inteamId INT,IN inseasonId INT,IN incategoryId int,IN inCompId INT,IN inVenueId varchar(1)) READS SQL DATA BEGIN IF NOT ISNULL(inCompId) THEN select * from tbl_matches where (HomeTeamID=inteamId OR AwayTeamID=inteamId) and mDate<=date(now()) and LeagueSeasonID = inseasonId and Team_catId=incategoryId and SeasonID = inseasonId and CompetitionID = inCompId order by mDate desc; ELSEIF NOT ISNULL(inVenueId) THEN select * from tbl_matches where (HomeTeamID=inteamId OR AwayTeamID=inteamId) and mDate<=date(now()) and LeagueSeasonID = inseasonId and Team_catId=incategoryId and SeasonID = inseasonId and venue = inVenueId order by mDate desc; ELSEIF (NOT ISNULL(inVenueId) AND NOT ISNULL(inCompId)) THEN select * from tbl_matches where (HomeTeamID=inteamId OR AwayTeamID=inteamId) and mDate<=date(now()) and LeagueSeasonID = inseasonId and Team_catId=incategoryId and SeasonID = inseasonId and CompetitionID = inCompId and venue = inVenueId order by mDate desc; ELSE select * from tbl_matches where (HomeTeamID=inteamId OR AwayTeamID=inteamId) and mDate<=date(now()) and LeagueSeasonID = inseasonId and Team_catId=incategoryId and SeasonID = inseasonId order by mDate desc; END IF; END $$ but when i supply : call sp_get_ourclubresults_details('6','12','2','7','H'); iget +-----------+-----------+------+-----------+------------+------------+---------------+-------+ | HomeScore | AwayScore | g_id | mo_th | h_name | a_name | CompetitionID | venue | +-----------+-----------+------+-----------+------------+------------+---------------+-------+ | 1 | 0 | 15 | May 2017 | CRYSTAL SA | Sebfwa FC | 7 | A | | 1 | 1 | 11 | May 2017 | Sebfwa FC | PARK YARD | 7 | H | +-----------+-----------+------+-----------+------------+------------+---------------+-------+ and when i supply: call sp_get_ourclubresults_details('6','12','2','7',''); i get this too +-----------+-----------+------+-----------+------------+------------+---------------+-------+ | HomeScore | AwayScore | g_id | mo_th | h_name | a_name | CompetitionID | venue | +-----------+-----------+------+-----------+------------+------------+---------------+-------+ | 1 | 0 | 15 | May 2017 | CRYSTAL SA | Sebfwa FC | 7 | A | | 1 | 1 | 11 | May 2017 | Sebfwa FC | PARK YARD | 7 | H | +-----------+-----------+------+-----------+------------+------------+---------------+-------+ 2 rows in set (0.00 sec) how can i solve this?
  15. thanks for you advice but i googled and got a php solution: $length=array(); for($j=0;$j<count($obj->mPlayerstatistics);$j++){ $arr_lge1=array(); $arr_lge1=explode(',',$obj->mPlayerstatistics[$j]['lge']); $length[$j]=count($arr_lge1); }$value = max($length);$key = array_search($value, $length);
  16. the above table is a result set from an sql query group_concated together.Haven;t you heard of the group_concat().
  17. I already did that and the issue is just how to compare the data and get the biggest one
  18. i have this table: +---------+-------+----------------+ | Snem | Nem | lge | +---------+-------+----------------+ | 2016/17 | Mwase | GBS CUP,NDIV V | | 2015/16 | Mwase | GBS CUP | +---------+-------+----------------+ 2 rows in set, 2 warnings (0.01 sec) how can i get the field with the longest or biggest string in the lge column using php? i have tried this so far by array comparison but failed: $length=array(); //loop through the rows of resultset for($j=0;$j<count($obj->mPlayerstatistics);$j++){ // get each string into an array $arr_lge1=explode(',',$obj->mPlayerstatistics[$j]['lge']); //get array length $length=count($arr_lge1); //do comparison with previous and store the biggest length if((count($length)>0)&& ($length[$j-1]>$length[$j])){$max=$j;}else{$max=0;} }
  19. i have this table +------+---------------------------------------------------------+---------------------+-------------------+--------+-------+ | P_id |shortname | group_concat(Apps1) | group_concat(Gls) | t_Apps | t_Gls | +------+---------------------------------------------------------+---------------------+-------------------+--------+-------+ | 1 | Friendly,NDIV V | 1,1 | 3,0 | 2 | 3 | | 2 | Friendly,NDIV V | 1,1 | 1,0 | 2 | 1 | | 3 | Friendly,NDIV V | 1,1 | 0,1 | 2 | 1 | | 4 | Friendly,NDIV V | 1,1 | 0,0 | 2 | 0 | | 10 | Friendly,NDIV V | 1,1 | 0,0 | 2 | 0 | | 11 | Friendly,NDIV V | 1,1 | 0,0 | 2 | 0 | | 12 | Friendly,NDIV V | 1,1 | 0,0 | 2 | 0 | | 13 | Friendly,NDIV V | 1,1 | 0,0 | 2 | 0 | +------+---------------------------------------------------------+---------------------+-------------------+--------+-------+ 8 rows in set, 1 warning (0.29 sec) how can i populate its data into an html table with this structure using php <table> <thead> <tr> <th class=" header" colspan="1">2015/2016</th> <th class=" header" colspan="2">NDIV V Lge</th> <th class=" header" colspan="2">Friendlies</th> <th class=" header" colspan="2">Total</th> </tr> <tr> <th class="header">P_id.</th> <th class=" header">Ap</th> <th class=" header">Gl</th> <th class=" header">Ap</th> <th class=" header">Gl</th> <th class="header">Ap</th> <th class="header">Gl</th> </tr> </thead> <tbody> <tr> <td>43</td> <td class=" ">0 + 0</td> <td class=" ">0</td> <td class=" ">0 + 0</td> <td class=" ">0</td> <td>0 + 1</td> <td>0</td> </tr><tr> <td>42</td> <td class=" ">0 + 0</td> <td class=" ">0</td> <td class=" ">0 + 0</td> <td class=" ">0</td> <td>0 + 2</td> <td>0</td> </tr><tr> <td>36</td> <td class=" ">1 + 0</td> <td class=" ">0</td> <td class=" ">0 + 0</td> <td class=" ">0</td> <td>7 + 10</td> <td>2</td> </tr></tbody> </table>
  20. I have this table (tblStats): +------+-----------+------+------------+----------+-------+------+ | P_id | ShortName | logo | SeasonName | SeasonID | Apps1 | Gls | +------+-----------+------+------------+----------+-------+------+ | 1 | Friendly | NULL | 2016/17 | 12 | 1 | 3 | | 1 | NDIV V | NULL | 2016/17 | 12 | 1 | 0 | | 2 | Friendly | NULL | 2016/17 | 12 | 1 | 1 | | 2 | NDIV V | NULL | 2016/17 | 12 | 1 | 0 | | 3 | Friendly | NULL | 2016/17 | 12 | 1 | 0 | | 3 | NDIV V | NULL | 2016/17 | 12 | 1 | 1 | | 4 | Friendly | NULL | 2016/17 | 12 | 1 | 0 | | 4 | NDIV V | NULL | 2016/17 | 12 | 1 | 0 | | 10 | Friendly | NULL | 2016/17 | 12 | 1 | 0 | | 10 | NDIV V | NULL | 2016/17 | 12 | 1 | 0 | | 11 | Friendly | NULL | 2016/17 | 12 | 1 | 0 | | 11 | NDIV V | NULL | 2016/17 | 12 | 1 | 0 | | 12 | Friendly | NULL | 2016/17 | 12 | 1 | 0 | | 12 | NDIV V | NULL | 2016/17 | 12 | 1 | 0 | | 13 | Friendly | NULL | 2016/17 | 12 | 1 | 0 | | 13 | NDIV V | NULL | 2016/17 | 12 | 1 | 0 | +------+-----------+------+------------+----------+-------+------+ 16 rows in set, 1 warning (0.07 sec) I have this query ti get records for a particular P_id from the table above: select P_id,group_concat(ShortName),group_concat(Apps1),group_concat(Gls),SUM(Apps1) as t_Apps,sum(Gls)as t_Gls from (SELECT houseid as P_id, ShortName, logo, SeasonName, SUM(Apps) as Apps1, SUM(Gl) as Gls FROM tblStats where SeasonName='2016/17' GROUP BY P_id ; which outputs: +------+-------------------------+---------------------+-------------------+--------+-------+ | P_id | group_concat(ShortName) | group_concat(Apps1) | group_concat(Gls) | t_Apps | t_Gls | +------+-------------------------+---------------------+-------------------+--------+-------+ | 1 | Friendly,NDIV V | 1,1 | 3,0 | 2 | 3 | | 2 | Friendly,NDIV V | 1,1 | 1,0 | 2 | 1 | | 3 | NDIV V,Friendly | 1,1 | 1,0 | 2 | 1 | | 4 | Friendly,NDIV V | 1,1 | 0,0 | 2 | 0 | | 10 | Friendly,NDIV V | 1,1 | 0,0 | 2 | 0 | | 11 | Friendly,NDIV V | 1,1 | 0,0 | 2 | 0 | | 12 | NDIV V,Friendly | 1,1 | 0,0 | 2 | 0 | | 13 | Friendly,NDIV V | 1,1 | 0,0 | 2 | 0 | +------+-------------------------+---------------------+-------------------+--------+-------+ But the shorname is not in order as in Friendly,NDIV V.But there is an interchange as we go on.This will affect the data displayed how can I clear this?
  21. how can i get all tha apps of each player from this table by seasonid for a particular ShortName (tournament)?eg all the Apps for houseid 12 in friendly in 1 column and NDIV V in another etc.Not tjat seasons can be different +---------+-----------+------+----------+------------+------+----+ | houseid | ShortName | logo | SeasonID | SeasonName | Apps | Gl | +---------+-----------+------+----------+------------+------+----+ | 5 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 18 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 13 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 6 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 1 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 14 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 7 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 2 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 15 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 8 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 3 | NDIV V | NULL | 12 | 2016/17 | 1 | 1 | | 16 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 9 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 4 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 17 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 10 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 5 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 18 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 11 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 6 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 12 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 7 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 13 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 8 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 1 | Friendly | NULL | 12 | 2016/17 | 1 | 3 | | 14 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 9 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 2 | Friendly | NULL | 12 | 2016/17 | 1 | 1 | | 15 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 10 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 3 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 16 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 11 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 4 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 17 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 12 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | +---------+-----------+------+----------+------------+------+----+ i have tried this but itgets me 1 row only: SELECT houseid as P_id, ShortName, logo, SeasonName, SUM(Apps) as Apps1, SUM(Gl) as Gls FROMtble stats;
  22. sorry it has to be by seasonId
  23. i have this table: +---------+-----------+------+----------+------------+------+----+ | playerid| ShortName | logo | SeasonID | SeasonName | Apps | Gl | +---------+-----------+------+----------+------------+------+----+ | 9 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 4 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 17 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 10 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 5 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 18 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 11 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 6 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 12 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 7 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 13 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 8 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 1 | Friendly | NULL | 12 | 2016/17 | 1 | 3 | | 14 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 9 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 2 | Friendly | NULL | 12 | 2016/17 | 1 | 1 | | 15 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 10 | NDIV V | NULL | 12 | 2016/17 | 1 | 0 | | 3 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | | 16 | Friendly | NULL | 12 | 2016/17 | 1 | 0 | How can I get the player statistics for a given competition like so,Getting the total Appearances(Apps),total goals(Gl)for each player in a particular competition I also wonder how to identify the player on bench for a particular game: KKL Lge NDIV Cup Friendly Cup Africa Other † Total playerId. Ap Gl Ap Gl Ap Gl Ap Gl Ap Gl Ap Gl 13 0 + 1 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 1 0 2 0 + 2 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 2 0 16 4 + 9 1 1 + 1 1 1 + 0 0 1 + 0 0 0 + 0 0 7 + 10 2 8 36 + 1 2 3 + 0 0 0 + 0 0 8 + 0 0 1 + 0 0 48 + 1 2 17 24 + 0 1 1 + 1 0 2 + 0 0 4 + 0 0 1 + 0 0 32 + 1 1
  24. is it possible to call a static function inside another static function within the same class holding them both like so: public static function checkFile(){//just check if good file before upload to db $result = false; $name = $this->getorigName(); $size = $this-> get_file_size(); $ext = $this->getExtension($name);
  25. ihave this table structure CREATE TABLE staff_details_tbl ( staff_id INT UNSIGNED NOT NULL AUTO_INCREMENT, SUsername_id varchar(255), Fname VARCHAR(60) NOT NULL, Lname VARCHAR(60) NOT NULL, D_O_B date, PRIMARY KEY (staff_id ) ); Fname and Lname for more than 1 human being can be the same i have this stored procedure code: declare l_staff_id int; insert into staff_details_tbl (Fname,Lname,D_O_BSUsername_id)values(inFname,inLname,inBdate,' '); select staff_id into l_staff_id from staff_details_tbl where Fname=inFname and Lname=inLname ; insert into staff_job_tbl(staff_id,Team_catId,job_id)values(l_staff_id,inteam,injob); ihave to select the staffid for insert into another table, there are some problems with using the last_insert_id() that is why i choose to select the staff_id here. but with no unique Fname or Lname,the repetition of same names causes an error of REsult contained more than one row no unique key because there re many people with a name like 'kamikazi' google and see. I need a way of getting that id how can I go about this??
×
×
  • 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.