Check if invoice contains mobile phone

I suggest that an else condition be used, so that the table ends up with the same number of columns regardless of mobile phone or not.


if($row['has_mobile'] != false) {
    echo '<td><img src="images/special_coupon.gif"></td>';
} else {
    echo '<td></td>';
}

What do you want to be in the table cell when it’s a mobile phone? An image called special_coupon.gif ?

Could you show us the markup that the code generates? If there is a difference in how mobiles are being displayed, that would suggest the problem is not with the SQL but with the output.

markup


<table width="500" border="0" cellspacing="0" cellpadding="4" class="acount">
<tr style="background-color:#CCCCCC; height:25px">
          <td>Order ID </td>
          <td>Order Date </td>
          <td>Order total</td>
		  <td>Coupon</td>
                 </tr> 

<tr><td valign=top>410</td><td valign=top>11-04-2010</td><td valign=top>NZ$ 582.00</td><td></td></tr>
<tr><td valign=top>409</td><td valign=top>11-04-2010</td><td valign=top>NZ$ 856.00</td><td></td></tr>
<tr><td valign=top>408</td><td valign=top>08-07-2009</td><td valign=top>NZ$ 1964.00</td><td></td></tr>
<tr><td valign=top>407</td><td valign=top>08-07-2009</td><td valign=top>NZ$ 1414.00</td><td></td></tr>
<tr><td valign=top>406</td><td valign=top>08-07-2009</td><td valign=top>NZ$ 856.00</td><td></td></tr>
</table>

vineet