[SOLVED] If Statement Problem...
Posted: Sat Sep 11, 2004 12:16 pm
Hi,
Not sure what's wrong with this code...
The test value is 0 right now, so the "Pending" option should be selected, but this is the HTML code that results...
Thus, it always shows "Fraudulent".
Thanks,
Josh
Not sure what's wrong with this code...
Code: Select all
<select name="select">
<option value="0" <? if ($row_orderdetail['status'] = 0) { echo "selected"; } ?> >Pending</option>
<option value="1" <? if ($row_orderdetail['status'] = 1) { echo "selected"; } ?> >Approved</option>
<option value="2" <? if ($row_orderdetail['status'] = 2) { echo "selected"; } ?> >Waiting For User Response</option>
<option value="3" <? if ($row_orderdetail['status'] = 3) { echo "selected"; } ?> >Fraudulent</option>
</select>Code: Select all
<select name="select">
<option value="0" >Pending</option>
<option value="1" selected >Approved</option>
<option value="2" selected >Waiting For User Response</option>
<option value="3" selected >Fraudulent</option>
</select>Thanks,
Josh