I have no idea. This causes seemingly random time-outs. These in turn break the flash that i am loading it into. Has anyone seen anything like this before?
<?php require_once('../includes/class.database.php'); require_once('../includes/dbConnectInfo.inc'); require_once('../includes/functions.php'); include('../includes/conn.php'); $cat = $_GET['category']; $result = mysql_query('SELECT * FROM media WHERE related_page_id=4 && type='copy' ORDER BY id ASC LIMIT 6'); $media = '<?xml version=\'1.0\' encoding=\'ISO-8859-1\' ?>\n'; $media .= '<content>\n'; while($row = mysql_fetch_array($result)) { $media .='<member>\n'; $body = $row[copy]; if($row[title] == '') { $media .= '<title><![CDATA['; $media .= 'Team'; $media .=']]></title>\n'; } elseif ($row['path']=='') { $name = explode('/',$row[title],2); $media .= '<name><![CDATA['; $media .= $name[0]; $media .=']]></name>\n'; $media .= '<job><![CDATA['; $media .= $name[1]; $media .=']]></job>\n'; } if($body !='') { $media .='<bio><![CDATA['; $media .= $body; $media .= ']]></bio>\n'; } $something = $row['id']; $result1 = mysql_query('SELECT * FROM media WHERE assets='$something''); $media .= '<images>'; while($row1 = mysql_fetch_array($result1)) { $img = explode('/',$row1[path],2); $media .= '<image url='$img[1]' />'; } $media .= '</images>\n'; $media .='</member>\n'; } $media .= '</content>'; echo $media; ?>
What happens if you add
set_time_limit(0);to the code? I usually add that line to long-executing code below the include statements.Since this works, let me elaborate.
By default, PHP scripts are set up to only execute for so long. I believe the limit is 30 seconds when PHP is installed, but this can be changed in the php.ini file. However, you might not want to allow all scripts to run for the same length of time – 30 seconds might be fine for most scripts. The
set_time_limitfunction allows you to set the execution time for one script. It takes an integer value which represents the number of seconds to run the script, but a value of 0 means the script will run forever.