我是新來的此語言。我正在一個網站上工作。我使用這樣的HTML文件:將PHP文件整合到HTML文件中
<html lang="en">
...
<div class="" id="temperatura" name="temp">
<?php require 'php/staticsTemp.php'; ?>
<h3 class="centered">Temperature</h3>
<hr>
<br>
<table class="tg" border="5">
<tr>
<th class="tg-031e">Temperature ºC</th>
<th class="tg-031e">Date & Time</th>
</tr>
<tr>
<td class="tg-031e">33</td>
<td class="tg-031e">44</td>
</tr>
</table>
</div>
...
</html>
而且我想將表中的值33和44替換爲PHP文件中的值。 我的PHP看起來像這樣:
<?php
include("ligacaobd.php");
$sql="SELECT * FROM Valores ORDER BY Momento DESC LIMIT 20";
$result = mysql_query($sql, $ligacaobd) or die(mysql_error());
$rowValor = mysql_fetch_assoc($result);
do
{
$data[date('d/m/Y H:i:s', $rowValor['Momento'])]=$rowValor['Temperatura'];
}
while ($rowValor= mysql_fetch_assoc($result));
?>
有什麼想法?我嘗試使用POST函數,但在HTML中不起作用。
w3schools經常有過時和不正確的信息,學習PHP工作的更好的地方是他們自己的手冊 - http://www.php.net/manual/en/index.php – Eeji
對於真正的基礎知識(if其他等)W3schools很好,但你是正確的官方文件更好 –