Php and html in echo output

I am using php with MSSQL, and I have this line below, which to me looks right, but its breaking the page.


echo "<td width='60' class='tableData'>".if ($data["Group_Member"]==1){."Yes".}else{."No".}."</td>";

Can somebody tell me where I’m going wrong with it.

Cheers

echo "<td width='60' class='tableData'>".(($data["Group_Member"]==1)?"Yes":"No")."</td>"; 

You need to use a ternary operator, or you need to rewrite it like so:

echo "<td width='60' class='tableData'>";
if ($data["Group_Member"]==1){
  echo "Yes";
} else {
  echo "No";
}
echo "</td>";

Thank you cpradio,

I understand that now, and it worked fine.

Cheers