I have to consult a MySQL database (Server version: 5.5.55-38.8-log - Percona Server (GPL), Release 38.8, Revision 11f5bbd) that carries the barrels of a brewery. The fields are few and simple: barrel number, lot, location and date of last movement. My problem is that when I do the query, the first result disappears , which, for example to check stock, gives us a barrel of less, and when a query is made to see how many barrels there are in a client, gives us one less and so with all the queries. Here is my code. The example is to consult all the barrels of a lot.
<?php
$result=mysql_query("select * from stock where lote='$lote'");
$row=mysql_fetch_array($result);
rsort($row);
<div class="row" style="background-color:#000">
<?php while ($row = mysql_fetch_array($result)) {?>
<div class="col-sm-1" style="background-color:#000">
<?php echo $row ["barril"];?>
</div>
<div class="col-sm-1" style="background-color:#000">
<?php echo $row['lote'];?>
</div>
<div class="col-sm-2" style="background-color:#000">
<?php echo $row ["ubicacion"];?>
</div>
<div class="col-sm-1" style="background-color:#000">
<?php echo $row['cap'];?>
</div>
<div class="col-sm-2" style="background-color:#000">
<?php echo $row['fechaultimo'];?>
</div>
<br/>
<?php } mysql_free_result($result);?>
</div>