php - 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>
解决方案
推荐阅读
- python - Python 5 周存储桶
- python - 找不到管理页面
- connection - SQL Developer 连接到 Exasol DB
- excel - 用于在所有单元格上重复直到找到空白单元格的 VBA 代码
- arrays - 在页面模板液体(Shopify)中显示来自 settings_data.json 的 JSON 数据数组
- docker - 在 docker 中运行的 Geth 发生 OOM
- android - 在 Android 之外实现 Wifi-Aware 应用程序
- websphere - 我们如何在 WebLogic 和 WebSphere 中设置 X-Frame-Options 响应标头?
- python - python mysql更新与来自json的api
- json - jq 将 JSON 子数组对象转换为分隔字符串