whileループの後にテキストボックスが空白になるのはなぜですか?whileループ後にテキストボックスが空白になる
whileループを削除すると、データが表示されますか?
これは以下のフォームです。あなたがページ全体に表示されなければならない値を、対応するために、あなたのコード内でvariabel $row
を使用
<form name="form" method="post" action="">
<input type="hidden" name="new" value="1" />
<p><input type="text" name="res_veop_id" placeholder="Enter VEOP ID" required value="<?php echo $row["res_veop_id"]; ?>"/></p>
<p><select class="selectpicker" name="res_title">
<option value="<?php echo $row["res_title"]; ?>"><?php echo $row["title_name"]; ?></option>
<?php
$title_count=1;
$title_sel_query="Select * from `tbl_title` ORDER BY `title_id` asc;";
$title_result = mysqli_query($con,$title_sel_query);
while($row = mysqli_fetch_assoc($title_result)) { ?>
<option value="<?php echo $row["title_id"]; ?>"><?php echo $row["title_name"]; ?></option>
<?php $title_count++; } ?>
</select>
</p>
<p><input type="text" name="res_first_name" placeholder="Enter Firstname" required value="<?php echo $row["res_first_name"]; ?>"/></p>
<p><input type="text" name="res_last_name" placeholder="Enter Lastname" required value="<?php echo $row["res_last_name"]; ?>"/></p>
<p><input type="text" name="res_dob" placeholder="Enter Date of Birth" required value="<?php echo $row["res_dob"]; ?>"/></p>
'ので。ループが終了すると、その配列は破棄されます。それは「範囲外」です。 – icecub
どうすればいいですか? –
whileループには別の変数を使用するだけです。 '$ row'以外のもの – icecub