Hello.
As the subject stated, I am in a middle of nowhere as I stumbled upon an issue. It is a bit tricky (for me, yes lol) as I have been wandering around the Internet without any similar issue as mine.
I’ve made tables joint which combine two (2) tables for data display, however, I created an ‘ENUM’ field for my work and it is pretty hard for me to populate it inside a select drop-list.
The goal is to, display the current selection value from the database (NONE) and the other one would be (PAID). Initially, each row will hold (NONE) value but I want to ensure that changes can be made anytime it is needed. Basically, an interchangeable situation.
I made a fairly stupid and irrelevant logic in the code (refer below). I want to know a better way to do it.
Here’s the code;
[php]while( $rowresult = mysqli_fetch_array( $query ) )
{
echo “
echo “
echo “
echo “
echo “
echo “
echo “”;
if( $rowresult['pay'] == 'NONE' )
{
echo "<td><select name='nonepay'>";
echo "<option value='".$rowresult['pay']."'>NONE</option>";
echo "<option value='PAID'>PAID</option></select></td>";
}
else
{
echo "<td><select name='paidpayment'>";
echo "<option value='".$rowresult['pay']."'>PAID</option>";
echo "<option value='NONE'>NONE</option></select></td>";
}
echo "</form>";
echo "</tr>";
}[/php]
Thank you. :