I’m currently trying to pull in two numbers (1 from a MySQL Database and another from a WordPress custom field) and multiply them.
E.g: <?php echo ($data['price'] / 2) * NUMBER-FROM-DATABASE ;?>
Can I pull in from the Database in a normal way and place the code in this formula or do I have to do something else with it?
Thanks in advance,
Barry
What you wrote would work~
I would recommend:
If you are concerned the value from DB might not be a int/float and could cause an error, type cast it: