次のコードがあります。
echo "<td><textarea wrap='soft' class=tarea3 name='inston[]'>".$r['inston']."</textarea></td>\n";
inston
その変数を使用して、ドロップダウン リストに関連付けたいと思います。ドロップダウンリストの作業コードがあります:
<tr><td class="tdt">
<?php te('Hosting Server');?>:</td> <td title='Select server'>
<select validate='required:true' class='mandatory' name='manufacturerid'>
<option value=''>Select</option>
<?php
foreach ($agents5 as $a) {
$dbid=$a['id'];
$atype=$a['label']; $s="";
if (isset($manufacturerid) && $manufacturerid==$a['id']) $s=" SELECTED ";
echo "<option $s value='$dbid' title='$dbid'>$atype</option>\n";
}
echo "</select>\n";
?>
</td></tr>
上記のドロップダウン スクリプトの SQL クエリ、
$sql="SELECT * FROM items where itemtypeid=32 OR itemtypeid=44 order by label";
$sth=db_execute($dbh,$sql);
while ($r=$sth->fetch(PDO::FETCH_ASSOC)) $agents5[$r['id']]=$r;
inston
上記のコードを使用して変数を関連付けるにはどうすればよいでしょうか?