Auto load data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greetings,

I'm designing a table with 21 columns and 3 rows (1-row column header, 2-row
data) store in .php file, and each cell of this table storing a value, that
I stored it using MySQL database. Now, I want all the values (just the
values, but NOT the table) shown on this page automatic update every
1-second.

So, I use "create_table.php" to create the table and automatic load
"get_data.php" every 1-second to retrieve data from database. Once the
"get_data.php" loaded, my IE only show those data and the table disappeared.

Please help. Thanks in advance.


========== start create_table.php ============

<html>
<head>
<title>Member Area</title>
<META HTTP-EQUIV=Refresh CONTENT="5; URL=get_data.php">
</head>
<body>
<center>

<table bgcolor="#EEEEEE" border="0" width="95%"><tr><td>
    <table bgcolor="#B6C7E5" border="0" width="100%"><tr><td>
      <table bgcolor="#FFFFFF" border="0" width="100%"><tr><td>

        <table border=0 bgcolor="#F7F7FF" width="100%">
          <tr><th colspan=21><font size=+1>RACING RESULT</font></td></tr>
          <tr bgcolor="#FFFFFF"><th colspan=21></tr>

          <tr>
          <td width="20%">1st row</td><td width="4%">1</td><td
width="4%">2</td><td width="4%">3</td><td width="4%">4</td>
          <td width="4%">5</td><td width="4%">6</td><td width="4%">7</td><td
width="4%">8</td><td width="4%">9</td>
          <td width="4%">10</td><td width="4%">11</td><td
width="4%">12</td><td width="4%">13</td><td width="4%">14</td>
          <td width="4%">15</td><td width="4%">16</td><td
width="4%">17</td><td width="4%">18</td><td width="4%">19</td><td
width="4%">20</td>
          </tr>

          <tr>
          <td width="20%">2nd row</td><td width="4%">' . $myWin1 . '</td><td
width="4%">' . $myWin2 . '</td><td width="4%">' . $myWin3 . '</td>
          <td width="4%">' . $myWin4 . '</td><td width="4%">' . $myWin5 .
'</td><td width="4%">' . $myWin6 . '</td><td width="4%">' . $myWin7 . '</td>
          <td width="4%">' . $myWin8 . '</td><td width="4%">' . $myWin9 .
'</td><td width="4%">' . $myWin10 . '</td><td width="4%">' . $myWin11 .
'</td>
          <td width="4%">' . $myWin12 . '</td><td width="4%">' . $myWin13 .
'</td><td width="4%">' . $myWin14 . '</td><td width="4%">' . $myWin15 .
'</td>
          <td width="4%">' . $myWin16 . '</td><td width="4%">' . $myWin17 .
'</td><td width="4%">' . $myWin18 . '</td><td width="4%">' . $myWin19 .
'</td>
          <td width="4%">' . $myWin20 . '</td>
          </tr>

          <tr>
          <td width="20%">3rd row</td><td width="4%">' . $myPlace1 .
'</td><td width="4%">' . $myPlace2 . '</td><td width="4%">' . $myPlace3 .
'</td>
          <td width="4%">' . $myPlace4 . '</td><td width="4%">' . $myPlace5
. '</td><td width="4%">' . $myPlace6 . '</td><td width="4%">' . $myPlace7 .
'</td>
          <td width="4%">' . $myPlace8 . '</td><td width="4%">' . $myPlace9
. '</td><td width="4%">' . $myPlace10 . '</td><td width="4%">' . $myPlace11
. '</td>
          <td width="4%">' . $myPlace12 . '</td><td width="4%">' .
$myPlace13 . '</td><td width="4%">' . $myPlace14 . '</td><td width="4%">' .
$myPlace15 . '</td>
          <td width="4%">' . $myPlace16 . '</td><td width="4%">' .
$myPlace17 . '</td><td width="4%">' . $myPlace18 . '</td><td width="4%">' .
$myPlace19 . '</td>
          <td width="4%">' . $myPlace20 . '</td>
          </tr>

        </table>
      </td></tr></table>
    </td></tr></table>
    </td></tr></table>
</center>
</body>
</html>

========== end create_table.php ============


========== start get_data.php ============

<?php
$result = @mysql_query('SELECT `myWin1`, `myWin2`, `myWin3`, `myWin4`,
`myWin5`, `myWin6`, `myWin7`, `myWin8`, `myWin9`, `myWin10`, `myWin11`,
`myWin12`, `myWin13`, `myWin14`, `myWin15`, `myWin16`, `myWin17`, `myWin18`,
`myWin19`, `myWin20`, `myPlace1`, `myPlace2`, `myPlace3`, `myPlace4`,
`myPlace5`, `myPlace6`, `myPlace7`, `myPlace8`, `myPlace9`, `myPlace10`,
`myPlace11`, `myPlace12`, `myPlace13`, `myPlace14`, `myPlace15`,
`myPlace16`, `myPlace17`, `myPlace18`, `myPlace19`, `myPlace20` FROM
Testing');
if (!$result) {
die('<p>Error performing query: ' . mysql_error() . '</p>');
}


while ( $row = mysql_fetch_array($result) )
{
  $myWin1 = $row['0'];
  $myWin2 = $row['1'];
  $myWin3 = $row['2'];
  $myWin4 = $row['3'];
  $myWin5 = $row['4'];
  $myWin6 = $row['5'];
  $myWin7 = $row['6'];
  $myWin8 = $row['7'];
  $myWin9 = $row['8'];
  $myWin10 = $row['9'];
  $myWin11 = $row['10'];
  $myWin12 = $row['11'];
  $myWin13 = $row['12'];
  $myWin14 = $row['13'];
  $myWin15 = $row['14'];
  $myWin16 = $row['15'];
  $myWin17 = $row['16'];
  $myWin18 = $row['17'];
  $myWin19 = $row['18'];
  $myWin20 = $row['19'];
  $myPlace1 = $row['20'];
  $myPlace2 = $row['21'];
  $myPlace3 = $row['22'];
  $myPlace4 = $row['23'];
  $myPlace5 = $row['24'];
  $myPlace6 = $row['25'];
  $myPlace7 = $row['26'];
  $myPlace8 = $row['27'];
  $myPlace9 = $row['28'];
  $myPlace10 = $row['29'];
  $myPlace11 = $row['30'];
  $myPlace12 = $row['31'];
  $myPlace13 = $row['32'];
  $myPlace14 = $row['33'];
  $myPlace15 = $row['34'];
  $myPlace16 = $row['35'];
  $myPlace17 = $row['36'];
  $myPlace18 = $row['37'];
  $myPlace19 = $row['38'];
  $myPlace20 = $row['39'];


echo('<tr><td width="20%">2nd row</td><td width="4%">' . $myWin1 . '</td><td
width="4%">' . $myWin2 . '</td><td width="4%">' . $myWin3 . '</td>
<td width="4%">' . $myWin4 . '</td><td width="4%">' . $myWin5 . '</td><td
width="4%">' . $myWin6 . '</td><td width="4%">' . $myWin7 . '</td>
<td width="4%">' . $myWin8 . '</td><td width="4%">' . $myWin9 . '</td><td
width="4%">' . $myWin10 . '</td><td width="4%">' . $myWin11 . '</td>
<td width="4%">' . $myWin12 . '</td><td width="4%">' . $myWin13 . '</td><td
width="4%">' . $myWin14 . '</td><td width="4%">' . $myWin15 . '</td>
<td width="4%">' . $myWin16 . '</td><td width="4%">' . $myWin17 . '</td><td
width="4%">' . $myWin18 . '</td><td width="4%">' . $myWin19 . '</td>
<td width="4%">' . $myWin20 . '</td></tr>');



echo('<tr><td width="20%">3rd row</td><td width="4%">' . $myPlace1 .
'</td><td width="4%">' . $myPlace2 . '</td><td width="4%">' . $myPlace3 .
'</td>
<td width="4%">' . $myPlace4 . '</td><td width="4%">' . $myPlace5 .
'</td><td width="4%">' . $myPlace6 . '</td><td width="4%">' . $myPlace7 .
'</td>
<td width="4%">' . $myPlace8 . '</td><td width="4%">' . $myPlace9 .
'</td><td width="4%">' . $myPlace10 . '</td><td width="4%">' . $myPlace11 .
'</td>
<td width="4%">' . $myPlace12 . '</td><td width="4%">' . $myPlace13 .
'</td><td width="4%">' . $myPlace14 . '</td><td width="4%">' . $myPlace15 .
'</td>
<td width="4%">' . $myPlace16 . '</td><td width="4%">' . $myPlace17 .
'</td><td width="4%">' . $myPlace18 . '</td><td width="4%">' . $myPlace19 .
'</td>
<td width="4%">' . $myPlace20 . '</td></tr>');

}
?>

========== end get_data.php ============

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux