My Assistant
|
|
Dec 16 2009, 06:48 PM
Post
#1
|
|
|
UtterAccess Addict Posts: 141 From: Launceston, Tasmania |
Please could someone look at the code associated with this error
Parse error: syntax error, unexpected T_ELSE, expecting ',' or ';' ... The code works with just the 'if' statment but fails with the above error when i add the 'else' component. Code <td width="13%"><p> <?php if ($row_rs_All['Fax']=="") echo "None" else echo $row_rs_All['Fax'}; ?></p> </td> New to PHP but have searched extensively and cannot find the error. Thanks in anticipation Damon |
|
|
|
![]() |
Dec 16 2009, 10:51 PM
Post
#2
|
|
|
Utterly Abby-Normal Posts: 9,781 From: Seattle, WA [USA] |
Hi Damon,
I'm not a PHP programmer... but from what I saw in various code snippets you are missing {} (you had an orphan } after the FAX... and an orphan [ before it) try (not tested): CODE <td width="13%"><p>
<?php if ($row_rs_All['Fax']=="") { echo "None" } else { echo $row_rs_All['Fax'] } ?></p> </td> |
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 18th June 2013 - 10:35 PM |