I am getting the following error when running this code:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/hourlyra/public_html/admin/photogallery/read.php on line 38
$content =
"
require_once('../../Connections/content.php');
// Load the tNG classes
require_once('../../includes/tng/tNG.inc.php');
// Make unified connection variable
$conn_content = new KT_connection($content, $database_content);
/*
SCRIPT FOR GENERATING AN XML FILE WITH DATABASE INFO FOR THE PHOTOGALLERY FLASH FILE
*/
//connection
require_once('../../Connections/content.php');
//Default recordsets
mysql_select_db($database_content, $content);
$query_master1photos_album = \"SELECT * FROM photos_album ORDER BY album_order ASC\";
$master1photos_album = mysql_query($query_master1photos_album, $content) or die(mysql_error());
$row_master1photos_album = mysql_fetch_assoc($master1photos_album);
$totalRows_master1photos_album = mysql_num_rows($master1photos_album);
mysql_select_db($database_content, $content);
$query_detail2photos_image = \"SELECT * FROM photos_image WHERE image_album_key='123456789' ORDER BY image_order ASC\";
$detail2photos_image = mysql_query($query_detail2photos_image, $content) or die(mysql_error());
$row_detail2photos_image = mysql_fetch_assoc($detail2photos_image);
$totalRows_detail2photos_image = mysql_num_rows($detail2photos_image);
//SCRIPT FOR THE XML FILE
//Send content type as text/xml so the browser knows it's an xml file
header('Content-type: text/xml');
//Generate xml data
echo '<?xml version=\"1.0\" encoding=\"utf-8\"?>';
echo '<gallery>';
do { echo '<album id=\"'.$row_master1photos_album['album_location'].'\" title=\"'.$row_master1photos_album['album_title'].'\" description=\"'.$row_master1photos_album['album_description'].'\" lgPath=\"http://thehourlyradio.com/upload/photogallery/'.$row_master1photos_album['album_location'].' /lg/\" tnPath=\"http://thehourlyradio.com/upload/photogallery/'.$row_master1photos_album['album_location'].'/tn/\" tn=\"\" startHere=\"\">';
if ($totalRows_master1photos_album>0) {
$nested_query_detail2photos_image = str_replace(\"123456789\", $row_master1photos_album['album_location'], $query_detail2photos_image);
mysql_select_db($database_content);
$detail2photos_image = mysql_query($nested_query_detail2photos_image, $content) or die(mysql_error());
$row_detail2photos_image = mysql_fetch_assoc($detail2photos_image);
$totalRows_detail2photos_image = mysql_num_rows($detail2photos_image);
$nested_sw = false;
if (isset($row_detail2photos_image) && is_array($row_detail2photos_image)) {
do { //Nested repeat
echo ' <img src=\"'.$row_detail2photos_image['image_filename'].'\" caption=\"'.$row_detail2photos_image['image_caption'].'\" link=\"'.$row_detail2photos_image['image_link'].'\"/>';
} while ($row_detail2photos_image = mysql_fetch_assoc($detail2photos_image));
}
}
echo ' </album>';
} while ($row_master1photos_album = mysql_fetch_assoc($master1photos_album));
echo '</gallery>';
mysql_free_result($master1photos_album);
mysql_free_result($detail2photos_image);
";
$handle = fopen("imageGeneratorXML.xml", 'w');
fwrite($handle, $content);