Dup of Some Basic PHP Questions
Hello,
I have a heap of tinyint fields in a mysql database I need to show with PHP. At the moment I am doing something like this:
if ($row['PAYPAL_ACCEPT'] == '1'){ $paypal = 'Yes'; else $paypal = 'No'; }
For each field, which is tedious and seems like there should be a better way, than using an if clause for each field. If there is, what is it?
Building on what’s already been suggested:
then you can access variables using the column names as variable names: