1
I need to wear the same select
other times, but I’m not getting it.
It shows the result in the first while
, but for the rest not.
On the same screen I will repeat by 4x, because I am referring to the tires: Right Front, Left Front, Right Rear, Left Rear.
MYSQL:
$rsMarca = $mysqli->query("SELECT * FROM pneu_marca");
$row_rsMarca = $rsMarca->fetch_assoc();
First While
<select name="marca_de">
<?php do { ?>
<option value="<?php echo $row_rsMarca['ID_Marca']; ?>">
<?php echo $row_rsMarca['marca']; ?>
</option>
<?php } while ($row_rsMarca = $rsMarca->fetch_assoc()); ?>
</select>
Second and other while
<select name="marca_dd">
<?php do { ?>
<option value="<?php echo $row_rsMarca['ID_Marca']; ?>">
<?php echo $row_rsMarca['marca']; ?>
</option>
<?php } while ($row_rsMarca = $rsMarca->fetch_assoc()); ?>
</select>
Having a problem, see how it is displayed (https://prnt.sc/npgvjn), in mysql this way (https://prnt.sc/npgvod)
– Tiago
Find the error...rsrs. Instead of
<?php foreach($row_rsMarca as $resultado) { ?>
era<?php foreach($rsMarca as $resultado) { ?>
.– Tiago
If in your query you put one
return
before$row_rsMarca
, I believe it would work without trading in foreach.– Miyukii