Page 1 of 1

going crazy? cannot find the reason for parse error

Posted: Wed Jun 08, 2005 9:16 pm
by tharkas
Hello,

I'm very tired at the moment but I don't think I did anything wrong with the script. But obviously I'm wrong and php parser is right. Here's the code. Its very simple but I cannot what's causing the error.

The error is "Parse error: parse error in artwork.php on line 49"

line 49 is the line after

Code: Select all

while ($test = mysql_fetch_array($viewthumb)
which is just a

Code: Select all

}
Here's the full script

Code: Select all

<?php
$i=1;
while($i < 4){
$i++;
$viewthumb = mysql_query("select * FROM  pictures where pictures.SecID=2 LIMIT 1, 15");
print('<tr>');
while ($test = mysql_fetch_array($viewthumb)
 {
print('
<td align="center" width="120"><img src="images/thumb/'.$test["PicFileName"].' alt="" width="100" height="137" border="1"></td>
');
}
print('</tr>');
}?>
There is no php code before this script except db connection which is working perfectly fine.

Thanks

Posted: Wed Jun 08, 2005 9:17 pm
by malcolmboston

Code: Select all

while ($test = mysql_fetch_array($viewthumb))
theres only 3 brackets, there should always be an even number as brackets come in pairs only

Posted: Wed Jun 08, 2005 9:17 pm
by MathewByrne
Very simple:

Code: Select all

while ($test = mysql_fetch_array($viewthumb))
You needed the extra ')' on the end of the while statement.

Posted: Wed Jun 08, 2005 9:18 pm
by tharkas
thanks a million :D

Posted: Wed Jun 08, 2005 9:19 pm
by malcolmboston
no problem, im here to help and be helped