I'm developing a new ordering system in PHP that works as follows:
- The user uploads the requests, which are stored in a MySQL table called requests ;
- After uploading, the user can change the status of these requests through script in PHP that make the UPDATE of the table requests ;
- Each change is saved through a trigger in a table called logs ;
- Orders have a unique and unique number that does not repeat.
I could create a link in the request number, for example, that invokes a modal, and within this modal view the changes that are in the logs table only of that number Clicked Order?
displaying MySQL data on the page:
$result = mysqli_query($connect, "SELECT * FROM 'pedidos'");
echo "<div style='height: 70%;'><table border='1' id='pedidos' class='table table-responsive'>
<tr>
<th><input type='checkbox' name='select-all' id='select-all' /></th>
<th>Data de emissão</th>
<th>EMS</th>
<th>Pedido do cliente</th>
<th>Cliente</th>
<th>Valor do pedido</th>
<th>Status</th>
<th>Nota Fiscal</th>
</tr>";
while($row = mysqli_fetch_array($result))
{
echo "</ul>";
echo "<tr>";
echo "<td><input name='checkbox[]' type='checkbox' value=" . $row['id'] . "></td>";
echo "<td>" . $row['emissaoPed'] . "</td>";
echo "<td><a data-toggle='modal' href='#myModal'>" . $row['nPedido'] . "</a></td>";
echo "<td>" . $row['NrPedido'] . "</td>";
echo "<td>" . $row['nomeAbrev'] . "</td>";
echo "<td>" . $row['vlr'] . "</td>";
echo "<td>" . $row['status'] . "</td>";
echo "</tr>";
}
echo "</table>";
echo "</form></div>";
I made the following query to bring the order by the order number:
$result = mysqli_query($connect, "SELECT * FROM 'logs' where nPedido IN (34366)");
However, I do not know how to replace the order number that is defined in the query with the requested order number.