triporia Posted September 3, 2008 Share Posted September 3, 2008 Hey guys. Im am brutally new at php and I am trying to remove a part of code from the following but it keeps giving me an error. The error is this: Syntax error, unexpected T_IF I'm lead to understand that if I remove the part of code that I want to, the "IF" statement will not function properly. This is the section I want to remove: '<tr class="c1"> '. ' <td align="right"><b>' . MSG_FULL_ADDRESS . '</b></td> '. ' <td>' . $user->full_address($user_details) . '</td> '. '</tr> '; And this is the entire section of code I believe: if ($user_id > 0) { $user_details = $db->get_sql_row("SELECT u.email, u.name, u.address, u.city, u.zip_code, u.phone, c.name AS country_name, s.name AS state_name, u.state FROM " . DB_PREFIX ."users u LEFT JOIN " . DB_PREFIX . "countries s ON u.state=s.id LEFT JOIN " . DB_PREFIX . "countries c ON u.country=c.id WHERE u.user_id=" . $user_id); $user = new user(); $contact_details .= '<tr class="c1"> '. ' <td align="right"><b>' . MSG_FULL_NAME . '</b></td> '. ' <td>' . $user_details['name'] . '</td> '. '</tr> '. '<tr class="c1"> '. ' <td align="right"><b>' . MSG_FULL_ADDRESS . '</b></td> '. ' <td>' . $user->full_address($user_details) . '</td> '. '</tr> '; if ($setts['enable_display_phone']) { $contact_details .= '<tr class="c1"> '. ' <td align="right"><b>' . MSG_PHONE . '</b></td> '. ' <td>' . $user_details['phone'] . '</td> '. '</tr> '; } $contact_details .= '<tr class="c1"> '. ' <td align="right"><b>' . MSG_EMAIL_ADDRESS . '</b></td> '. ' <td>' . $user_details['email'] . '</td> '. '</tr> '; } } } PLEASE HELP!! Link to comment https://forums.phpfreaks.com/topic/122482-solved-noobs-needs-help-please/ Share on other sites More sharing options...
AndyB Posted September 3, 2008 Share Posted September 3, 2008 edit this: $contact_details .= '<tr class="c1"> '. ' <td align="right">' . MSG_FULL_NAME . '</td> '. ' <td>' . $user_details['name'] . '</td> '. '</tr> '. '<tr class="c1"> '. ' <td align="right">' . MSG_FULL_ADDRESS . '</td> '. ' <td>' . $user->full_address($user_details) . '</td> '. '</tr> '; to this: $contact_details .= '<tr class="c1"> '. ' <td align="right">' . MSG_FULL_NAME . '</td> '. ' <td>' . $user_details['name'] . '</td> '. '</tr> '; Link to comment https://forums.phpfreaks.com/topic/122482-solved-noobs-needs-help-please/#findComment-632463 Share on other sites More sharing options...
triporia Posted September 3, 2008 Author Share Posted September 3, 2008 Ahh.... the case of the semi-colon. Thank you very much sir, I hope to utilize your genius in the future. Chris Link to comment https://forums.phpfreaks.com/topic/122482-solved-noobs-needs-help-please/#findComment-632468 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.