Jump to content

Parse error: syntax error, unexpected T_IF


premora

Recommended Posts

Hello,  I am struggling here with a T_IF error.  The IF Statement is inside a WHILE Loop and I have been searching for the dreaded missing ;'s that normally make these errors.

 

Please help.

 

The error line is in RED

Here's the code:

 

while ( $row = mysql_fetch_array($result) ) {   

echo("<table width='750' height='165' border='0' bgcolor='#DDDEFF' align='center'>

<tr>

<td width='107' height='30' align='center' bgcolor='#B73230'><b><font size='2' face='Arial, Helvetica, sans-serif' color='FFFFFF'>" . $row["name"] . "<br>ID: " . $row["L_ID"] . "</font></b></td>

<td colspan='7' bgcolor='#2B2FE3' align='center'><img src='images/arrows.jpg'></td>

</tr>

<tr><td rowspan='4' valign='top'><div align=center><img src=images/avatar/".$row["L_ID"] ."s.jpg></div></td>

<td width='10' rowspan='3'> </td>

<td width='43' height='30'><b>Event: </b></td>

<td width='100'><font size='2' face='Arial, Helvetica, sans-serif'>" . $row["title"] . "</font></td>

<td width='10' rowspan='3'> </td>

<td align='right'><b>Location: </b></td>

<td width='160'><font size='2' face='Arial, Helvetica, sans-serif'>" . $row["location"] . "</font></td>

<td width='170' align='center'><img src='images/titleAttendingEvents.jpg'></td>

</tr>

<td align='right' height='30'><b>Date: </b></td>

<td><font size='2' face='Arial, Helvetica, sans-serif'>" . date('d/m/Y', strtotime($row['event_date'])) ."</font></td>

<td align='right'><b>Post Code: </b></td>

<td><font size='2' face='Arial, Helvetica, sans-serif'>" . $row["postCode"] . "</font></td>

<td width='170' align='center'><font size='4'>" . $row["attend"] . "</font></td>

</tr>

<tr>

<td align='right' height='30'><b>Time: </b></td>

<td height='30'><font size='2' face='Arial, Helvetica, sans-serif'>" . $row["time"] . "</font></td>

<td align='right'><form name='email_host' method='post' action='email_host.php'><input type='hidden' name='id' value='" . $row["L_ID"] . "'><input type='hidden' name='title' value='" . $row["title"] . "'><input type='image' src='images/icons/email_s.jpg' align='absmiddle' height='30' alt='Email Host'><b><font size='2' face='Arial, Helvetica, sans-serif'> Email </b></font></form></td>

<td align='center'><form name='attending' method='post' action='attend_send.php'><input type='hidden' name='id' value='" . $row["id"] . "'><input type='submit' name='attend_event' value='Attend Event'></form></td>

<td width='170' align='center'><img src='images/icons_group.jpg'></td>

</tr>

<tr>"

if ($row['cancel'] == 1) {

echo "<td colspan='4' height='30' align='center'><font size='3' face='Arial, Helvetica, sans-serif' color='red'><b>CANCELLED</b></font</td>";

} else {

echo "<td colspan='4' height='30'> </td>";

}

echo "

<td align='center' height='30'><form name='myForm' method='post' action='event_details.php'><input type='hidden' name='event_id' value='" . $row["id"] . "'><input type='image' src='images/btn_event_details.jpg' align='absmiddle' height='30' alt='View Full Event Details'></form></td>

</tr>

</table>

<br>");

}

Link to comment
Share on other sites

<tr>"
if ($row['cancel'] == 1) { 

->

<tr>";
if ($row['cancel'] == 1) { 

 

And theres one more at the end of your code in echo statement. At the beginning of echo you dont use bracket, but at the end as finish you use it.

Link to comment
Share on other sites

Yep, as i sad theres an other problem at the and of your code. Put a bracket after echo...

echo ("
<td align='center' height='30'><form name='myForm' method='post' action='event_details.php'><input type='hidden' name='event_id' value='" . $row["id"] . "'><input type='image' src='images/btn_event_details.jpg' align='absmiddle' height='30' alt='View Full Event Details'></form></td>
</tr>
</table>
<br>");
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.