Hello,
I am trying to fetch the data. It comes good, however, the fields numbers are somehow messed up.
Here is my code:
<?$sn = 2;
$result_sibl = mysql_query("SELECT parid,AES_DECRYPT(snhk,'encrypt') as snhk FROM sibl_table WHERE parid = '$ID'");
for ($i=1;$i<=$sn;$i++) {
while ($array_sibl = mysql_fetch_array($result_sibl)) { ?>
<input type="text" name="qV_snsn[<?echo $i?>]" id="qV_snsn<?echo $i?>" value="<?echo $array_sibl['snsn']?>" />
<? } }?>
What I get is this:
<input type="text" name="qV_snsn[1]" id="qV_snsn1" value="Aaa" />
<input type="text" name="qV_snsn[1]" id="qV_snsn1" value="Bbb" />
What I want is this:
<input type="text" name="qV_snsn[1]" id="qV_snsn1" value="Aaa" />
<input type="text" name="qV_snsn[2]" id="qV_snsn2" value="Bbb" />
could you please tell me where I am making the mistake?
Thanks in advance 🙂