Forum Moderators: coopster

Message Too Old, No Replies

Display only if greater than zero

         

kndsharp

2:21 am on Mar 16, 2009 (gmt 0)

10+ Year Member



Hello, hoping someone can help me get this php "if" statement correct.

I have a table driven by mysql db and I would like to only show the value of my sale price ['Prod_Sale'] when it is greater than "0".

My current statement:

<?php echo $row_Recordset1['Prod_Sale']; ?>

pulls the field value just fine, but the "if" statements I've tried to designate print only if "> 0" have not been successful.

Any help is appreciated.

Habtom

5:02 am on Mar 16, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<?php $row_Recordset1['Prod_Sale']>0?echo $row_Recordset1['Prod_Sale']:""; ?>

kndsharp

7:25 am on Mar 16, 2009 (gmt 0)

10+ Year Member



Thank you, it's working now.