Web ページに 3 列の MySQL テーブルを印刷しています。2 番目の列を除いて、すべてが印刷されます。空白です。
私が使用しているコードは次のとおりです。
$connection = mysql_connect($hostname, $username, $password);
if (!$connection)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("MEASURE", $connection);
$numberz = 54;
mysql_query("INSERT INTO measurement (DATA)
VALUES
('$numberz')");
$result = mysql_query("SELECT * FROM measurement");
echo "<table border='1'>
<tr>
<th>ID</th>
<th>DATA</th>
<th>TIME</th>
</tr>";
while ($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" . $row['ID'] . "</td>";
echo "<td>" . $row['DATE'] . "</td>";
echo "<td>" . $row['TIME'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($connection);
これは私が私のウェブページで得たものです:
ID DATA TIME
1 2013-02-26 14:32:26
2 2013-02-26 14:32:26
3 2013-02-26 14:32:27
2 番目の列が空白になっていることに注意してください
MySQL でのテーブルの外観は次のとおりです。
ID | data | TIME
| 1 | 1 | 2013-02-26 14:32:26 |
| 2 | 1 | 2013-02-26 14:32:26 |
| 3 | 1 | 2013-02-26 14:32:27 |