syntax error, unexpected T_STRING, expecting ',' or ';' in line 5

HI Experts

I am trying to add an icon to the output of a php snippet and get the following error

syntax error, unexpected T_STRING, expecting ',' or ';' in line 5

The code snippet is below. I have separated the block to make easier to see.
Could you indicate what I have done wrong please.

Thanks


$query_silotreeLevel2 = "SELECT theme_keywords, SiloID, SiloFlag, CompetingPages, theme_keywordsid FROM theme_keywords WHERE SiloID = " . addslashes($rw_silotreeLevel1['theme_keywordsid']) . " AND SiloFlag='Article' ORDER By SiloNavOrder ASC, CompetingPages DESC";
$silotreeLevel2 = mysql_query($query_silotreeLevel2, $dws) or die(mysql_error());
while ($rw_silotreeLevel2 = mysql_fetch_assoc($silotreeLevel2)) {
      

if($rw_silotreeLevel2['CompetingPages'] > $rw_silotreeLevel1['CompetingPages']) {
      echo '<img src="images/ico_alpha_CheckMarkGreen_16x16.png" alt="Passed" title="Passed" width="16" height="16" />';
      }else{echo '<img src="images/ico_alpha_CheckMarkGreen_16x16.png" alt="Passed" title="Passed" width="16" height="16" />';
      }


  $silotreeL2 = '<span class="silotree_level2"><span class="silotree_opener">';
  $silotreeL2 .= '<img src="FXInc/none.gif" width="16">';
  $silotreeL2 .= '</span><span><a href="inc.update.root.keyword.php?profileid=' .$_GET['profileid']. '&clid=' .$_GET['clid']. '&tkid=' . addslashes($rw_silotreeLevel2['theme_keywordsid']) . '&theme_keywordsid=' . addslashes($rw_silotreeLevel2['theme_keywordsid']) . '&tkw=' . addslashes($rw_silotreeLevel2['theme_keywords']) . '&returnPath='.$file.'" target="_blank" rel="width:850,height:550,ajax:true" id="pf_multiBox1" class="pf_multiBox1" title="'. $rw_silotreeLevel2['theme_keywords'] .' | ID:'. $rw_silotreeLevel2['theme_keywordsid'] .'">';
  if ($FX_imgdecsilotree) $silotreeL2 .= '<img src="' . $FX_imgcontsilotree . '" id="silotree__'.$i1.'_'.$i2.'_F">';
  $silotreeL2 .= '<span class="silotree_category">' . $rw_silotreeLevel2['theme_keywords'].'</span></a></span></span>'."\n";
  $silotreeL2 .= '<div id="silotree__'.$i1.'_'.$i2.'_S">'."\n";
  $silotree["L2"][$i1-1][] = $silotreeL2;
$i3 = 1;
matthewdacruzAsked:
Who is Participating?
 
Pratima PharandeCommented:
if($rw_silotreeLevel2['CompetingPages'] > $rw_silotreeLevel1['CompetingPages']) {
      echo "<img src='images/ico_alpha_Delete_16x16.png' alt='Failed' title='Failed' width='16' height='16' />";
      }else{echo "<img src='images/ico_alpha_CheckMarkGreen_16x16.png' alt='Passed' title='Passed' width='16' height='16' />";
      }
0
 
matthewdacruzAuthor Commented:
Sorry I have fixed the icon duplicate issue in the if stament but have the same syntax error.

if($rw_silotreeLevel2['CompetingPages'] > $rw_silotreeLevel1['CompetingPages']) {
      echo '<img src="images/ico_alpha_Delete_16x16.png" alt="Failed" title="Failed" width="16" height="16" />';
      }else{echo '<img src="images/ico_alpha_CheckMarkGreen_16x16.png" alt="Passed" title="Passed" width="16" height="16" />';
      }
0
 
Loganathan NatarajanLAMP DeveloperCommented:
are you sure the variables are getting values to the query?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.