I want a code in which i place a number i-e 2 and its table like 2x1=2 comes as outpt

Discussion in 'PHP' started by sairab, Nov 7, 2008.

  1. #1
    can anyone give me this table generation code right now?
     
    sairab, Nov 7, 2008 IP
  2. sairab

    sairab Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    php code i want right now
     
    sairab, Nov 7, 2008 IP
  3. shineDarkly

    shineDarkly Banned

    Messages:
    241
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    hmm, it seems like you want something like an excel db, i dont think its possible with mysql
     
    shineDarkly, Nov 7, 2008 IP
  4. Shoro

    Shoro Peon

    Messages:
    143
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    
    $num = 2;
    echo '<table border="1">';
    for ($i = 1; $i <= 100; $i++) {
      $result = $num * $i;
      echo "<tr><td>{$num}x{$i}</td><td>$result</td></tr>";
    }
    echo '</table>';
    
    PHP:
    You mean like that?
     
    Shoro, Nov 7, 2008 IP