Hi,
Does anyone know on why $row['cr_no'], $row['exp_mth'] and $row['exp_yr'] is getting not displayed for cr_no, exp_mth and exp_yr? only cr_card is getting displayed properly.
The following is my code:
while ($row=mysql_fetch_array($result))
{ echo "cr_no: ". $row['cr_no'];
$sql="select cr_card from credit_card_det where cr_card<>'".$row['cr_card']."'";
$result=mysql_query($sql) or die(mysql_error());
?>
<div class='form_general'>
<form action="manage_credit_cards.php" method="post">
<div class='form_label' style='left:7%;top:inherit;'>Payment</div>
<div class='form_element' style='top:inherit;left:14%; vertical-align:middle;'>
<select name='cr_card'>
<?php
echo "<option selected>".$row["cr_card"]."</option>";
while ($row=mysql_fetch_array($result))
echo "<option>".$row['cr_card']."</option>";
echo "</select>";
echo "Card Number:";
[COLOR="Red"]echo "<input type='text' name='cr_no' maxlength='16' value='".$row["cr_no"]."'>";[/COLOR] ?>
Expiration Date:
<select name="exp_mth">
<?php
for ($mth=1; $mth<=12; $mth++)
{if ($row['exp_mth']=="0".$mth)
[COLOR="red"]printf("<option selected>%02u</option>", $row['exp_mth']);[/COLOR] else
printf("<option>%02u</option>",$mth); //0 padding 2 unsigned decimal numbers --- refer to php.net sprintf function
}
?>
</select>
<?php
$today = getdate();
?>
<select name="exp_yr">
<?php
for ($yr=$today["year"]; $yr<=$today["year"]+20; $yr++)
//if (isset($_SESSION['exp_yr']) || isset($_POST['exp_yr']))
{ [COLOR="red"]if ($row['exp_yr']==$yr)
echo "<option selected>".$row['exp_yr']."</option>";[/COLOR] else
echo "<option>".$yr."</option>";
}
?>
</select>
</div>
<div class="form_element" style="top:inherit;left:70%;">
<input type='submit' value='OK' />
</div>
</form>
</div>
<?php
}//end while ($row= mysql_fetch_array....)
?>
thank you.