首页 > 解决方案 > Fetch while data from DB and parse to another php, takes only 1 row

问题描述

How I can parse a fetched while data from DB to another php ? It will parse only ONE row... Ex: file "index.php", I need the <select name="cabinet_o"> to parse value into "another.php". Thank you.

|index.php|

<tr class="initial" onMouseOver="this.className='highlight'" onMouseOut="this.className='normal'" >
<td width="272"><font face="Tahoma"><span style="font-size:12pt;">
<select name="cabinet_o">
<option value="<?php echo $id_cabinet;?>" selected><?php echo $nume_cabinet;?></option>
<?php
$db_name4_a="av3";
$table_name4_a = "cabinete";
$connection4_a = mysqli_connect($h, $u, $p) or die("Couldn't connect.");
$db4_a = mysqli_select_db($connection4_a,$db_name4_a) or die("Couldn't select database.");
$sql4_a = "SELECT * FROM `$table_name4_a` where `cab_activ` = 'DA' and `TEST` = 'NU' order by `nume_cabinet` ASC";
$result4_a = mysqli_query($connection4_a,$sql4_a) or die("Couldn't execute query.22");
while ($row4_a = mysqli_fetch_array($result4_a)) {
$nume_cabinet_o = $row4_a['nume_cabinet'];
$id_cabinet_o = $row4_a['id_cabinet'];
?>
<option value="<?php echo $id_cabinet_o;?>"><?php echo $nume_cabinet_o;?></option>
<?php
}
?>
</select>
</span></font>
</td>
</tr>

|another.php|

<?php
$abc = $_POST['cabinet_o'];
?>
<tr class="initial" onMouseOver="this.className='highlight'" onMouseOut="this.className='normal'" >
<td width="134"><font face="Tahoma"><span style="font-size:12pt;"><?php echo $abc;?></span></font></td>
</tr>

标签: phphtmljquery

解决方案


推荐阅读