Page 1 of 1

if statement not working

Posted: Tue Mar 16, 2010 7:44 am
by kevinwinters
Hi, I am looping through a recordset and can't understand why this row always displays "n/a" even though some of the "date_sold" fields actually contain a date.

If I remove the "if" clause and simply display the row, I get the date_sold dates to display when they occur. What could I be doing wrong?

Code: Select all

 
 
if($row->date_sold = '0000-00-00 00:00:00'){
        $sHtml .= '<td nowrap>n/a</td>';
    } else {  
        $sHtml .= '<td nowrap>'.Format_Date($row->date_sold).'</td>';
    }  
 
 

Re: if statement not working

Posted: Tue Mar 16, 2010 7:47 am
by papa
if($row->date_sold == '0000-00-00 00:00:00')

Re: if statement not working

Posted: Tue Mar 16, 2010 9:41 am
by kevinwinters
yes, of course, thank you. keep getting stuck on this due to my ASP experience.