Answer the question
In order to leave comments, you need to log in
How to make a table select from a select for a query?
The code:
$list = "";
$result = $db->query( "SELECT * FROM ".PREFIX."_tovar_post WHERE id!=''" );
if( $db->num_rows( $result ) > 0 )
{
while( $row = $db->get_row( $results ) )
{
$id = $row['id'];
$title = htmlspecialchars( stripslashes( $row['title'] ), ENT_QUOTES, $config['charset'] );
$list .= <<<HTML
<option value="{$id}">ID:{$id} - {$title} </option>
HTML;
}
}
else
{
$list = "<tr><td colspan=\"10\" style=\"padding: 15px; text-align: center;\">нет товаров</td></tr>";
}
$list = <<<HTML
<div class="form-group">
<div class="col-sm-4">
<select class="uniform" name="id" >
{$list}
</select>
</div>
<div class="col-sm-4">
<select class="uniform" name="dost" >
<option value="offer_dostavka">Доставка</option>
<option value="offer_dostavka_uk">Доставка по УКР</option>
<option value="offer_dostavka_ru">Доставка по РОС</option>
</select>
</div>
<div class="col-sm-4">
<input type="submit" name="submit" value="Привязать доставка" class="btn bg-brown-600 btn-sm btn-raised legitRipple" />
</div>
</div>
HTML;
echo $list;
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question