Jump to content

Aravinthan

Members
  • Posts

    162
  • Joined

  • Last visited

    Never

Posts posted by Aravinthan

  1. I have nothing...  :shrug:

     

    I start coding but I hit a wall, and erase that try again, and I hit a wall...

     

    I tought of using a code wildteen came up with, but that code uses lines to split...

     

    But in this text file, the lines change from 1 game to another...

     

    So that really messes me up...

     

  2. Hi,

    I am having kinda of an issue.

     

    Ok so what I want to do is, show the 8 teams from 1 conference.

    SO far so good....

     

    Here is the code which does that:

    SELECT * FROM teams LEFT JOIN teams_numbers ON teams.team_name = teams_numbers.ProName WHERE teams_numbers.Conference ='Est' AND `divison` != `divison` Order by ((`nhl_wins` *2) + `nhl_ot`) DESC
    

     

    But here is the tricky part, There is 3 division in 1 conference. So what I want is:

    The top 3 teams must not be in teh same division.

    For exemple:

     

    Division 1

    Division 2

    Division 3

     

     

    So for exemple the team with the most points, in division 1 will be placed in the top 3 even if the a team that has more points but is 2nd Division 2.

     

    I dont know if I am explaining well...

     

    For people who know it, its the same as the NHL way of ranking....

     

    Let say there is 15 teams, in 1 conference and 5 teams in each division.

     

    Teams(ordered by most points):

     

    Team 1 -> Division 1

    Team 2 -> Division 2

    Team 3 -> Division 2

    Team 4 -> Division 3

    Team 5 -> Division 1

    Team 6 -> Division 2

    Team 7 -> Division 1

    Team 8 -> Division 3

    Team 9 -> Division 2

    ...

     

     

    So the rankings should be:

     

    Team 1 -> Division 1

    Team 2 -> Division 2

    Team 4 -> Division 3 ( Although Team 3 has more points, he cant be third, as there is already a team from division 2 in the top 3)

    .. The rest are orderd by points...

     

     

    Is there a way of doing this?

     

     

  3. Hi guys,

     

    Ok so here is the problem, I got 2 complicated text files, that I need to read...

     

    First file(reportss.txt):

    #2500

    Toronto Maple Leafs 2 , New York Islanders 3

    Shots: 20 - 26

    TOR PP: 1 of 4 (3 shots), Passing:61/78=78 %, Challenges:33/38=84 %

    NYI PP: 0 of 5 (10 shots), Passing:73/90=81 %, Challenges:40/52=75 %

    Attendance: 8821 of 18819 (Air Canada Centre)

    Ticket income: 279626 Match televised: No

                 

     

    Toronto Maple Leafs scoring.

                            ( G  A  Sh Hi Ga Ta PIM, +/-  Icetime Rating)

    R Loui Eriksson          0  0  0  0  0  0    0  -2    6.00    6

    R Mark Parrish            0  0  1  4  0  6    0    0  14.30    8

    R Viktor Kozlov          0  0  1  0  0  0    0    0    9.00    6

    R Teemu Selänne          1  1  5  0  0  0    0    0  19.20    8

    C Patrik Berglund        0  0  1  0  1  0    0  -2    7.50    6

    C Mike Ribeiro            0  1  1  0  0  0    4    0  20.20    7

    C Stephen Weiss          0  0  1  1  0  0    0    0  15.50    6

    C Stu Barnes              0  0  2  0  0  0    4    0  16.00    7

    L Sean Bergenheim        0  0  1  0  0  0    0  -2    6.00    6

    L Brooks Laich            0  0  0  0  1  1    0    0  16.30    6

    L Niklas Hagman          0  0  2  1  1  1    0    0  16.40    7

    L Jason Blake            0  1  1  0  0  0    0    0  20.50    7

    D Matt Niskanen          0  0  0  1  1  0    0    0  20.00    6

    D Jack Johnson            0  0  0  1  0  0    0  -1  11.10    6

    D Kenny Jönsson          1  1  2  1  1  0    0  -1  27.40    8

    D Jonas Frögren          0  0  0  2  0  2    0    0  15.20    7

    D Willie Mitchell        0  0  2  2  0  0    0    0  19.00    7

    D Sheldon Souray          0  0  2  2  0  2    2  -2  26.50    7

                            (GA,  A, Sv , PIM, +/- Icetime Rating)

    G Ed Belfour              3  0  23  0    0  58.50    6

    G Justin Pogge            0  0  0    0    0    0.00    0

                 

    New York Islanders scoring.

                            ( G  A  Sh Hi Ga Ta PIM, +/-  Icetime Rating)

    R Jeremy Williams        0  0  1  0  0  0    0    0    5.20    6

    R Kyle Okposo            0  0  1  0  1  0    0    1  15.10    7

    R Jamal Mayers            1  1  2  2  1  0    0    1  20.40    9

    R Richard Park            0  0  2  2  3  0    2    0  18.50    6

    C Frans Nielsen          0  0  0  0  0  0    2    0    5.20    6

    C Mark Bell              0  0  2  1  0  0    0    1  15.50    8

    C Doug Weight            0  1  2  2  0  0    0    1  19.00    8

    C Joe Sakic              0  0  4  0  1  0    0    0  19.50    7

    L Jon Sim                0  0  1  3  0  1    2    0    5.20    7

    L Andy Hilbert            1  0  1  1  0  2    0    1    8.30    7

    L Ladislav Nagy          1  1  3  1  0  0    0    1  18.30    8

    L Darcy Tucker            0  0  4  1  0  0    0    0  20.20    8

    D Niklas Grossman        0  0  0  0  0  1    0    1    8.30    6

    D Mark Streit            0  0  0  0  0  0    0    1  20.00    7

    D Andy Sutton            0  0  0  1  2  1    2    0  29.20    7

    D Staffan Kronwall        0  0  0  0  1  0    0    1    9.30    5

    D Freddy Meyer            0  1  5  1  3  0    0    1  23.50    7

    D Jay Bouwmeester        0  0  1  2  0  0    0    0  28.50    7

                            (GA,  A, Sv , PIM, +/- Icetime Rating)

    G Marty Turco            2  0  18  0    0  60.00    8

    G Curtis Joseph          0  0  0    0    0    0.00    0

                 

    Three stars of the game:

    1st star: Jamal Mayers

    2nd star: Ladislav Nagy

    3rd star: Teemu Selänne

                 

    Notes for Toronto Maple Leafs:

     

    Notes for New York Islanders:

     

    Other notes:

     

     

    ###

     

    Here is the second file(boxscores.txt):

    #2500

    12:37 0-1 NYI Jamal Mayers [1] (Ladislav Nagy, Doug Weight)

    ------------------------------------------------------------

    31:49 0-2 NYI Ladislav Nagy [1] (Jamal Mayers, Freddy Meyer)

    37:16 1-2 TOR Teemu Selänne [1] (Jason Blake, Kenny Jönsson)

    ------------------------------------------------------------

    41:49 1-3 NYI Andy Hilbert [1])

    48:49 2-3 TOR Kenny Jönsson [1] (Teemu Selänne, Mike Ribeiro)PP

    ------------------------------------------------------------

     

    This is only the 1st data.

     

    There is alot like this, so what I want to do is:

     

    - Insert the 2500(gameID) in a MYSQL coloum named id

     

    - Insert:

    Toronto Maple Leafs 2 , New York Islanders 3
    in a Mysql coloum name result

     

    - Insert:

    Toronto Maple Leafs scoring.

                            ( G  A  Sh Hi Ga Ta PIM, +/-  Icetime Rating)

    R Loui Eriksson          0  0  0  0  0  0    0  -2    6.00    6

    R Mark Parrish            0  0  1  4  0  6    0    0  14.30    8

    R Viktor Kozlov          0  0  1  0  0  0    0    0    9.00    6

    R Teemu Selänne          1  1  5  0  0  0    0    0  19.20    8

    C Patrik Berglund        0  0  1  0  1  0    0  -2    7.50    6

    C Mike Ribeiro            0  1  1  0  0  0    4    0  20.20    7

    C Stephen Weiss          0  0  1  1  0  0    0    0  15.50    6

    C Stu Barnes              0  0  2  0  0  0    4    0  16.00    7

    L Sean Bergenheim        0  0  1  0  0  0    0  -2    6.00    6

    L Brooks Laich            0  0  0  0  1  1    0    0  16.30    6

    L Niklas Hagman          0  0  2  1  1  1    0    0  16.40    7

    L Jason Blake            0  1  1  0  0  0    0    0  20.50    7

    D Matt Niskanen          0  0  0  1  1  0    0    0  20.00    6

    D Jack Johnson            0  0  0  1  0  0    0  -1  11.10    6

    D Kenny Jönsson          1  1  2  1  1  0    0  -1  27.40    8

    D Jonas Frögren          0  0  0  2  0  2    0    0  15.20    7

    D Willie Mitchell        0  0  2  2  0  0    0    0  19.00    7

    D Sheldon Souray          0  0  2  2  0  2    2  -2  26.50    7

                            (GA,  A, Sv , PIM, +/- Icetime Rating)

    G Ed Belfour              3  0  23  0    0  58.50    6

    G Justin Pogge            0  0  0    0    0    0.00    0

     

    In home_team scoring

     

    - Insert:

    New York Islanders scoring.

                            ( G  A  Sh Hi Ga Ta PIM, +/-  Icetime Rating)

    R Jeremy Williams        0  0  1  0  0  0    0    0    5.20    6

    R Kyle Okposo            0  0  1  0  1  0    0    1  15.10    7

    R Jamal Mayers            1  1  2  2  1  0    0    1  20.40    9

    R Richard Park            0  0  2  2  3  0    2    0  18.50    6

    C Frans Nielsen          0  0  0  0  0  0    2    0    5.20    6

    C Mark Bell              0  0  2  1  0  0    0    1  15.50    8

    C Doug Weight            0  1  2  2  0  0    0    1  19.00    8

    C Joe Sakic              0  0  4  0  1  0    0    0  19.50    7

    L Jon Sim                0  0  1  3  0  1    2    0    5.20    7

    L Andy Hilbert            1  0  1  1  0  2    0    1    8.30    7

    L Ladislav Nagy          1  1  3  1  0  0    0    1  18.30    8

    L Darcy Tucker            0  0  4  1  0  0    0    0  20.20    8

    D Niklas Grossman        0  0  0  0  0  1    0    1    8.30    6

    D Mark Streit            0  0  0  0  0  0    0    1  20.00    7

    D Andy Sutton            0  0  0  1  2  1    2    0  29.20    7

    D Staffan Kronwall        0  0  0  0  1  0    0    1    9.30    5

    D Freddy Meyer            0  1  5  1  3  0    0    1  23.50    7

    D Jay Bouwmeester        0  0  1  2  0  0    0    0  28.50    7

                            (GA,  A, Sv , PIM, +/- Icetime Rating)

    G Marty Turco            2  0  18  0    0  60.00    8

    G Curtis Joseph          0  0  0    0    0    0.00    0

     

    In away_team_scoring

     

     

    - Insert this:

    12:37 0-1 NYI Jamal Mayers [1] (Ladislav Nagy, Doug Weight)

    ------------------------------------------------------------

    31:49 0-2 NYI Ladislav Nagy [1] (Jamal Mayers, Freddy Meyer)

    37:16 1-2 TOR Teemu Selänne [1] (Jason Blake, Kenny Jönsson)

    ------------------------------------------------------------

    41:49 1-3 NYI Andy Hilbert [1])

    48:49 2-3 TOR Kenny Jönsson [1] (Teemu Selänne, Mike Ribeiro)PP

    ------------------------------------------------------------

    In boxscore

     

    - Insert this:

    Three stars of the game:

    1st star: Jamal Mayers

    2nd star: Ladislav Nagy

    3rd star: Teemu Selänne

     

    In three_stars

     

    - Insert :

    Notes for Toronto Maple Leafs:

    In Home_team_notes

     

    Notes for New York Islanders:

    in away_team_notes

     

    Other notes:

    in other_notes

     

    And sometimes, after like 10-30 games

    there is farm team results,

    that appears underneath the other notes,

     

    So that goes in:

    farm_team_results

     

    I tried to make something for almost 2 weeks now, without getting anything...

     

    So it's time for me to see the experts,

     

    Any help is appreciated,

     

    Thanks Ara

  4. Hi guys,

     

    I was wondering,

    I have this MYSQL Select code:

    SELECT * FROM `schedule`  WHERE `month` = '12 'AND `year`='2009' AND `home_team`='16' OR `away_team`='16' ORDER BY `day` ASC
    

     

    It shows results from every month and every year...

     

    Why is that? The only 2 thing that it takes into consideration is the home_team and away_team and the Order By....

  5. Hi,

    OK so I dont get the problem.

     

    The link says:

    name=Ryan%20O%27Reilly

     

    And %20 = Space

    %27 = single quote...

     

    So far so good right no?

     

    Well not quite, I put it in a variable:

    $player = $_GET['name'];
    

    And when I echo it out:

    Ryan O\'Reilly

     

    Where did that slash comes from?

     

    In the link, there is no slash....

     

    Thanks for your help,

    Ara

  6. Hi,

     

    I have a little problem.

     

    I am fetching data from MYSQL database, with the fied name, Name.

    Ok so the thing is some of the name have single quotes in them.

    SO when I want to pass it via $GET to another page, it doesnt show the full name...

     

    The other page, takes the value and prints information for that name...

     

    I tried addslahses, without any help...

    Is there a word-around?

     

     

    Thanks for your help,

    Ara

  7. Hi,

     

    I am having problem with a very very simple code.

    I use it alot and it never caused me this much of trouble. Its been like 2-3 hours that I am trying to figure it out...

    :facewall: :facewall: :facewall:

     

    Ok here is the code:

    		$result = mysql_query("SELECT * FROM history ORDER BY `id` DESC LIMIT 0,5",$link);
    		while($row = mysql_fetch_array($result))
    {
    $history = "" .$row['history']. "";
    $playerid = substr($history, 0, 4);
    
    $getp = mysql_query("SELECT * FROM `players`  WHERE `id` = '$playerid' ",$link);
    $player_name = mysql_fetch_array($getp) or die(mysql_error());
    $Player = "" .$player_name['name']. "";
    
    echo "$Player $history<br/>";
    }
    ?>
    

     

     

    I echoed $playerid, alone and it shows it well...

    I tried running the Select sql, in PHP MyAdmin, it works..

     

    Its only:

    $player_name = mysql_fetch_array($getp) or die(mysql_error());
    

     

    That seems to be bugging, but I have no idea why....

     

     

    Thanks, for your help,

    Ara

  8. Hi,

     

    I am trying to put 2 tables next to each other...

     

    But it keeps going on the bottome, even if there is alot of space next to each other...

     

    WHy is that?

     

    Here is the table code:

    <table>
     			<caption>Meilleurs Buteurs</caption>
     			<thead>
     				<tr>
     					<th>Nom</th>
     					<th>PJ</th>
     					<th>Bts</th>
     				</tr>
     			</thead>
     			<tfoot>
     				<tr>
     					<th colspan='3'> </th>
     				</tr>
     			</tfoot>
    				<tr>
    					<td>Name</td>
    					<td>PJ</td>
    					<td>Goals</td>
    				</tr>
    				<tr class="odd">
    					<td>Name</td>
    					<td>PJ</td>
    					<td>Goals</td>
    				</tr>
    				<tr>
    					<td>Name</td>
    					<td>PJ</td>
    					<td>Goals</td>
    				</tr>
    			</table> 
    		<table>
     			<caption>Meilleurs Pointeurs</caption>
     			<thead>
     				<tr>
     					<th>Nom</th>
     					<th>PJ</th>
     					<th>Pts</th>
     				</tr>
     			</thead>
     			<tfoot>
     				<tr>
     					<th colspan='3'> </th>
     				</tr>
     			</tfoot>
    				<tr>
    					<td>Name</td>
    					<td>PJ</td>
    					<td>Points</td>
    				</tr>
    				<tr class="odd">
    					<td>Name</td>
    					<td>PJ</td>
    					<td>Points</td>
    				</tr>
    				<tr>
    					<td>Name</td>
    					<td>PJ</td>
    					<td>Points</td>
    				</tr>
    			</table>
    

  9. Nicely tought  ;D

     

     

    But, Its not working, I am thinking maybe I am placing it wrong...

     

    So here is the code:

    	</tfoot>
    	<?php
    error_reporting(0);
    $link = mysql_connect ("localhost", "", "")
    	or die("mysql_error()");
    	mysql_select_db ("liguehs_league", $link);
    $class = "class=\'odd\'";
    $action = $_GET['action'] ;
    switch ($action) {
    case "all":
    // Toute les equipes
    
    $result = mysql_query("SELECT * FROM `teams` ",$link);
    					while($row = mysql_fetch_array($result))
    			{
    if ($class == "class=\'odd\'") { // this will rotate the value.
          $class = "";
          }else{
          $class = "class=\'odd\'";
       }
    echo "<tr $class><td><a href='team.php?name=" .$row['team_name']. "'>" .$row['team_name']. "</a></td>";
    
    

     

    Its only part of it.... But seems ot not be working

  10. Hi guys,

     

    Here is my problem,

     

    I am extracting data from a MYSQL table and formatting it into a table.

     

    But what I want is that the first row should be:

     
    <tr>
    

    The second one to be:

     
    <tr class='odd' >
    

    Third one:

     
    <tr>
    

    And so on.... I am pretty sure its simple ,but I cant put my finger on it....  :facewall: :facewall: :facewall: :facewall:

×
×
  • 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.