<?php
include("db_connect.php");
$result = mysql_query("SELECT * FROM options");
while ($row = mysql_fetch_array($result)) {
$yearOptions .= '<option>'.$row["year"].'</option>';
$typeOptions .= '<option>'.$row["type"].'</option>';
$engineOptions .= '<option>'.$row["engine"].'</option>';
}
?>
<?php
$result = mysql_query("SELECT * FROM bmw");
while ($row = mysql_fetch_array($result)) {
?>
<div class="auto-select">
<div class="auto-name"><?php echo''.$row["name"].''?></div>
<div class="auto-image"><img src="<?php echo''.$row["image"].''?>"></div>
<div class="options">
<form id="options" action="../blocks/podbor.php" method="POST">
<select class="option-class option" name="type"><?php echo''.$typeOptions.''?></select>
<select class="option-year option" name="year"><?php echo''.$yearOptions.'' ?></select>
<select class="option-type option" name="engine"><?php echo''.$engineOptions.''?></select>
<input type="submit"class="option option-button" ></div>
</form>
</div>
<?php } ?>
Как должно получиться
<div class="bar">
<div class="auto-select">
<div class="auto-name">Овощи-2</div>
<div class="auto-image"><img src="img.png"></div>
<div class="options">
<form id="options" action="../blocks/podbor.php" method="POST">
<select class="option-year option" name="year">
<option>Яблоко-2</option>
<option>Апельсин-2</option>
<option>Груша-2</option>
<option>Виноград-2</option>
</select>
<input type="submit"class="option option-button" >
</form>
</div>
</div>
<div class="auto-select">
<div class="auto-name">Овощи-1</div>
<div class="auto-image"><img src="img.png"></div>
<div class="options">
<form id="options" action="../blocks/podbor.php" method="POST">
<select class="option-year option" name="year">
<option>Укроп-1</option>
<option>Петрушка-1</option>
<option>Морковь-1</option>
<option>Бурак-2</option>
</select>
<input type="submit"class="option option-button" >
</form>
</div>
</div>