Hi all. i get the following error . could any one help me fixing it.Thanks
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in
error pointing to :
PHP Code:
$query = "INSERT INTO music (`ID`,`friendID`,`friendPicture`,`friendName`) VALUES ('$ID',' . $friend['id'] . ',' . $friend['picture'] . ',' . $friend['name'] . ')";
PHP Code:
....
....
foreach ($friends as $friend)
{
//here you can write to mysql
if ($_POST['format'] == 'table')
{
fwrite($handle, '
<tr>
<td><a href="http://www.somsite.com/id=' . $friend['id'] . '">' . $friend['id'] . '</a></td>' . (!empty($_POST['photos']) ? '
<td><img src="' . $friend['picture'] . '" alt="" /></td>' : '') . '
<td>' . $friend['name'] . '</td>
</tr>');
$query = "INSERT INTO music (`ID`,`friendID`,`friendPicture`,`friendName`) VALUES ('$ID',' . $friend['id'] . ',' . $friend['picture'] . ',' . $friend['name'] . ')";
$fp = fopen("videos.txt", "w");
fwrite($fp, $query);
fclose($fp);
$result = mysql_query( $query );
}
else
fwrite($handle, '<li>
<a href="http://www.somsite.com/id=' . $friend['id'] . '">
' . (!empty($_POST['photos']) ? '<img src="' . $friend['picture'] . '" alt="" /><br />
' : '') . $friend['name'] . '
</a><br />
</li>');
}