[Solved] How can I get data from database into HTML table?


You need PHP for this

first you have to connect PHP with your db

$connection = mysqli_connect("YourHost","user","password","dbName") or die('connection to DB failed');

then you need a query to get the team names

$query = mysqli_query($connection,"SELECT team FROM s1");

now you need a array to save the DB values

$row = mysqli_fetch_array($query,MYSQLI_NUM);

the connection to the DB can now be closed

mysqli_close($connection);

after all you can print the values in the table

<table>
<tr>
<td><p> team name <?php if(isset($row[0])){
echo $row[0]; 
}else{
echo 'noName';
} ?></p></td>
</tr>
<tr>
<td><p> team name <?php if(isset($row[1])){
echo $row[1]; 
}else{
echo 'noName';
} ?></p></td>
</tr>
</table>

this should work

2

solved How can I get data from database into HTML table?