[solved] debug

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
matthiasone
Forum Contributor
Posts: 117
Joined: Mon Jul 22, 2002 12:14 pm
Location: Texas, USA
Contact:

[solved] debug

Post by matthiasone »

where is the unexpecting $

I get the following error message
Parse error: parse error, unexpected $ in /usr/www/users/faog/gallery_fns.php on line 86

Code: Select all

<?	

function gallery_thumbnail($gallery, $pnum = 1)
&#123;	
  $query = "select * from gallery_info where gallery = '".$gallery."'";
  $result = query_db($query);
  $gallery = mysql_fetch_assoc($result);
  $start = (10 * ($pnum - 1)) + 1;
  $query = "select * from gallery where gallery = '".$gallery."' LIMIT ".$start.", 10";
  $result = query_db($query);
  $num_rows = mysql_num_rows($result);
  for ($i=0; $i <= $num_rows-1; $i++)
  &#123;	
	$pics = mysql_fetch_assoc($result);
	if($pics&#1111;'width'] >= $pics&#1111;'height'])
	&#123;
	  $twidth = 100;
	  $theight = ($pics&#1111;'height'] * 100) / $pics&#1111;'width'];
	&#125;
	elseif($pics&#1111;'width'] < $pics&#1111;'height'])
	&#123;
	  $twidth = ($pics&#1111;'width'] * 100) / $pics&#1111;'height'];
	  $theight = 100;
	&#125;
	if($i == 0)
	&#123;
	  $body = "<tr>\n<td><img src='images/galleries/".$pics&#1111;'filename']."' width='".
	  		  $twidth."' height='".$theight."'></td>\n";
	  if(isnull($pics&#1111;'caption'])) 		  
	    $cbody = "<tr>\n<td>&nbsp;</td>\n";
	  else  
	    $cbody = "<tr>\n<td>".$pics&#1111;'caption']."</td>\n";
	&#125;	
	if($i == $num_rows-1)
	&#123;
	  $body = "<tr>\n<td><img src='images/galleries/".$pics&#1111;'filename']."' width='".
	  		  $twidth."' height='".$theight."'></td>\n</tr>\n";
	  if(isnull($pics&#1111;'caption'])) 		  
	    $cbody = "<tr>\n<td>&nbsp;</td>\n</tr>\n";
	  else  
	    $cbody = "<tr>\n<td>".$pics&#1111;'caption']."</td>\n</tr>\n";
	  $body = $cbody;	
	&#125;	
	if($i > 0 AND $i < 4)
	&#123;
	  $body .= "<td><img src='images/galleries/".$pics&#1111;'filename']."' width='".
	  		  $twidth."' height='".$theight."'></td>\n<td width='10'>&nbsp;</td>\n";
	  if(isnull($pics&#1111;'caption'])) 		  
	    $cbody .= "<td>&nbsp;</td>\n<td width='10'>&nbsp;</td>\n";
	  else  
	    $cbody .= "<td>".$pics&#1111;'caption']."</td>\n<td width='10'>&nbsp;</td>\n";
	if($i == 4)
	&#123;
	  $body = "<tr>\n<td><img src='images/galleries/".$pics&#1111;'filename']."' width='".
	  		  $twidth."' height='".$theight."'></td>\n</tr>\n";
	  if(isnull($pics&#1111;'caption'])) 		  
	    $cbody = "<tr>\n<td>&nbsp;</td>\n</tr>\n";
	  else  
	    $cbody = "<tr>\n<td>".$pics&#1111;'caption']."</td>\n</tr>\n";
	  $body = $cbody;	
	&#125;	
	if($i > 4 AND $i < 10)
	&#123;
	  $body .= "<td><img src='images/galleries/".$pics&#1111;'filename']."' width='".
	  		  $twidth."' height='".$theight."'></td>\n<td width='10'>&nbsp;</td>\n";
	  if(isnull($pics&#1111;'caption'])) 		  
	    $cbody .= "<td>&nbsp;</td>\n<td width='10'>&nbsp;</td>\n";
	  else  
	    $cbody .= "<td>".$pics&#1111;'caption']."</td>\n<td width='10'>&nbsp;</td>\n";
	&#125;	
  &#125;
?> 
<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#FFFFFF">
  <tr>
    <td align="center" colspan="9"><img src="images/gallery/<?=$gallery&#1111;'title']?>'></td>
  </tr>
  <tr>
    <td align="center" colspan="9">&nbsp;</td>
  </tr>
  <?=$body?>
  </table>
</td>
</tr>
</table>
<?
&#125;
Last edited by matthiasone on Thu Dec 09, 2004 1:54 pm, edited 1 time in total.
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

please post php code inside

Code: Select all

tags


you may have forgotten to close a curly bracket } or missing a quote somewhere.

try counting how many { you have, it should be the same as how many }
matthiasone
Forum Contributor
Posts: 117
Joined: Mon Jul 22, 2002 12:14 pm
Location: Texas, USA
Contact:

solved..........

Post by matthiasone »

must be blind in one eye and can't see out the other
Post Reply