Why is my class throwing this error?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello again list,
Im writing a class to display a bunch of pictures form my DB and when
I call a function through the class I get an error and I dont quite
understand why.  Now Im fairly new to classes so this might be
something that is totally obvious, but I cant seem to figure it out.
The code below is that which produces the error.  The error is thrown
if i pass values to the function or not.  If i take the default string
for $move out it works fine until I need to test the value of $move on
line 54. the same error is thrown on that line.  It doesnt make sens
to me.  All help is appreciated, thanks much!


gallery2.php
--
include('./includes/gallery.class');
$gal1 = new Gallery;
$gal1->displaygallery(FALSE, 0, 'forward', 10);
--


gallery.class
--
class Gallery {

//Edited out to save space

//Special Page Constructs
function displaygallery($user = FALSE, $lastprinted = 0, $move =
'forward', $limit = 10) {//Line 52
 while ($num_pics_printed <= $limit) {
  if ($move == 'forward') {//Line 54
	 $nextprint = $lastprinted++;
	 }
	else {
	 $nextprint = $lastprinted--;
	 }
  $printing_pic_values = grabpicinfo($nextprint);
  if (canuserseepic($user, $printing_pic_values)) {
   $mysql_select_user_values = mysql_fetch_assoc(mysql_query('SELECT
user_sn FROM Users WHERE user_id=' .
$printing_pic_values['pic_user']));
 	
   $folder_path = strtolower($mysql_select_user_values['user_sn']) . '/';
   print '<div class="gallery_container"><a href="pictures/' .
$folder_path . $printing_pic_values['pic_id'] . '.png"><img
src="pictures/' . $folder_path . $printing_pic_values['pic_id'] .
't.png" alt="' . $printing_pic_values['pic_title'] . '" /></a><br
/><div class="gallery_comment">' .
$printing_pic_values['pic_descript'] . '</div></div>' . "\n\n";
   }
  }
 }
}
--


Error thrown
--
Parse error: parse error, unexpected T_STRING in
/home/blacknut/public_html/picserv/includes/gallery.class on line 52
--

--nathan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux