Hi,
I'm looping through some database rows to display the content in a table. Basically, it's for some professionals who may or may not have credentials after their name. So some will be John Smith and some will be John Smith, MA. If they list credentials, I need to insert a comma before the credentials. I tried putting an if clause in my td but I'm getting an error. Is it my syntax or my logic that's wrong? Is there a better way to do this? Here's the code:
PHP Code:<td>" . $row['f_name'] . " " . $row['mi'] . " " . $row['l_name'] .
if ($row['credentials']) {
" , " . $row['credentials'];
}
"</td>






Bookmarks