I have a php file that shows me data from a table (bd mysql), on the other hand, I have an HTML file where I have a table with CSS styles and everything working, I would like to apply these styles with the data extracted from the base data through PHP, is this possible? I have tried to place the php code in the html but it does not read it and vice versa.
Table of php:
table with styles (bootstrap):
Use Xampp, mysql data base (PHPMYADMIN).
Here the PHP code:
<!DOCTYPE html>
<html lang="ES">
<head>
<meta charset="UTF-8">
<title>Matxus - información de productos</title>
</head>
<body>
<?php
$server ="localhost";
$usuario = "test";
$password = "1234";
$bd = "matxus";
$conexion = mysqli_connect($server,$usuario,$password,$bd) or die("error en la conexion");
// TABLA PROVEEDORES
$consulta = mysqli_query($conexion, "SELECT * FROM proveedores") or die("error al extraer los datos");
echo '<table border="1">';
echo '<tr>';
echo '<th id="idproveedor">Identificador</th>';
echo '<th id="empresa">Nombre Empresa</th>';
echo '<th id="comercial">Comercial</th>';
echo '<th id="telefono">Teléfono</th>';
echo '</tr>';
while($extraido = mysqli_fetch_array($consulta)) {
echo '<tr>';
echo '<td>'.$extraido['idproveedor'].'</td>';
echo '<td>'.$extraido['empresa'].'</td>';
echo '<td>'.$extraido['comercial'].'</td>';
echo '<td>'.$extraido['telefono'].'</td>';
echo '</tr>';
}
mysqli_close($conexion);
echo '</table>';
?>
</body>
</html>
Code of my table in HTML
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>ID</th>
<th>Nombre de Empresa</th>
<th>Comercial</th>
<th>Teléfono</th>
</tr>
</thead>
<!-- DATOS A EXTRAER DE BD.PROVEEDORES -->
<tbody>
<tr>
<td>1</td>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<td>2</td>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<td>3</td>
<td>Larry</td>
<td>the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
</div>
As I mentioned in the HTML file, the styles are applied. thanks for the help.