I'm beginner in php and html so I need your help. I am trying to display data from my sql database created using phpmyadmin , to a php page.
I've searched the internet and found similar topics , but still have problems
DB: wban ...
Table name: Jack ...
columns to be displayed: Temprature ,pulse , Motion ...
Here is my code , a blank page appear when request "localhost/Jack.php"
<?php
$conn=mysql_connect('localhost', 'root', 'MYPASSWORD');
mysql_select_db('wban');
if(! $conn ) {
die('Could not connect: ' . mysql_error());
}
$query = "SELECT * FROM Jack";
$result = mysql_query($query);
?>
<html>
<head> <title> Jack Status </title> </head>
<body>
<table width="600" border="1" cellpadding="1" cellspacing="1">
<tr> <!-- header row -->
<th>Data</th>
<th>Latest Readings</th>
<th>Average</th>
<th>Standard Deviation</th>
<th>Condition</th>
</tr>
<?php
while($row = mysql_fetch_assoc($result)){ //Create a loop to loop through results
echo "<tr>"
echo "<td>.$row['Temprature'].</td>"
echo "<td>.$row['Pulse'].</td>"
echo "<td>.$row['Motion'].</td>"
echo "</tr>"
}//end while
mysql_close(); //close out the database connection
?>
</table>
</body>
</html>