Forum Moderators: coopster

Message Too Old, No Replies

parse error

         

kumarsena

3:37 pm on Nov 3, 2003 (gmt 0)

10+ Year Member



hi,

can anyone help me out on this..
i get the following error message

Parse error: parse error, expecting `','' or `';''

with following code....

foreach ($data as $line)
{
echo <td> <img src=\"/thumb/'$line'\"> </td>;
$row =$row + 1;

if ( $row = 4 ) {

echo </tr> <tr>;
$row = 0;

}

}


thanks..
kumar

coopster

3:45 pm on Nov 3, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You have a couple things wrong here. First, you need to echo or print your strings encolsed in quotes. Second, your if statement is assigning, not comparing:

foreach ($data as $line)
{
echo "<td> <img src=\"/thumb/$line\"> </td>";
$row =$row + 1;
if ( $row == 4 ) { // notice the '==' here for comparison!
echo '</tr> <tr>';
$row = 0;
}

}

kumarsena

3:59 pm on Nov 3, 2003 (gmt 0)

10+ Year Member



holy ,

:)

thanks
didnt realise that one...this is why i love this forum..
sheers
kumar