Hi - I am designing my first php page and I have 2 colums for price, one for "price" and one for "saleprice"... as well as a column that tells me if an item is on sale "Y" or "N"...
Can someone help me write a simple script to display the "saleprice" and not the "price" if sale = Y...
I know it's really simple, but I am still a noobie, and need a little help. Here is my script for displaying the regular price:
<?php echo $row_shoes['price']; ?>
Any help would be GREATLY appreciated!
Thanks!
Displaying a sale price if something is on sale...
Moderator: General Moderators
your a third of the way there.
of course I have made a few assumptions but you should get the general idea.
Code: Select all
<?php
if($row_shoes['onSale']=='Y')
echo $row_shoes['salePrice'];
else
echo $row_shoes['price'];
?>