Considering the few data you provided, I believe your solution is something similar to this:
<?php
$con = new PDO("mysql: host=localhost;dbname=stackoverflow;charset=utf8", "root", "");
$con->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);
$con->setAttribute( PDO::ATTR_EMULATE_PREPARES, false );
$stmt = $con->prepare("select * from dados where empresa = ?");
$stmt->bindValue(1, $_GET['empresa']);
$stmt->execute();
$resultado = $stmt->fetchAll();
?>
<table>
<thead>
<tr>
<th>Dado1</th>
<th>Dado2</th>
<th>Dado3</th>
</tr>
</head>
<tbody>
<?php
foreach($resultado as $dados)
{
echo
'
<tr>
<td>'.$dados->dado1.'</td>
<td>'.$dados->dado2.'</td>
<td>'.$dados->dado3.'</td>
</tr>
';
}
?>
</tbody>
</table>
Now, if you just want to show part of the result and when the user presses a link or button shows another part, in your query you will need to use OFFSET and LIMIT and learn how to make paging. For example:
select * from dados where empresa = ? limit 3 offset 5
In this case this query will select at most 3 lines from the sixth line.
What’s wrong? Just add a new
<tr>
and their<td>
for each field– Jefferson Quesado
Every month the amount of data will vary, I need it to be automated.
– Luigi Azevedo
As you can see in the answer, the work to write two lines is the same as to write 100000 lines in the table. I don’t understand the difficulty yet
– Jefferson Quesado
But I edit the code every month is not automation, I have no way to change every file I create because new data entered, understand?
– Luigi Azevedo
You are using two language tags of your own to serve dynamic web pages/languages 2.0. If you only serve static pages, then you should automate the writing of this static page. So, what is your difficulty?
– Jefferson Quesado