Jump to content

shaddf

Members
  • Content count

    102
  • Joined

  • Last visited

Community Reputation

0 Neutral

About shaddf

  • Rank
    Advanced Member
  1. shaddf

    making video links

    <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. shaddf

    summing using dynamic sql

    why not can you explain more please?
  3. shaddf

    summing using dynamic sql

    Iam using prepared statements to do this. And when i prepare that answer of yours ,it does not work
  4. shaddf

    summing using dynamic sql

    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. shaddf

    calculation in a query

    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. shaddf

    calculation in a query

    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. shaddf

    calculation in a query

    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. shaddf

    selecting data

    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. shaddf

    selecting data

    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. shaddf

    selecting data

    +---------+---------------+----------+------+-------------------------------+----------+---------------+-----------------------+ | 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. shaddf

    selecting data

    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. shaddf

    getting different values from query

    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. shaddf

    getting biggest field value

    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);
×

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.