08-07-2009, 10:04 AM
|
#1 (permalink)
|
|
The Contributor
Join Date: Jul 2009
Posts: 80
Thanks: 13
|
time out issues with this script
Code:
$quary = @$_GET['q'];
$query = "SELECT COUNT(id) as num FROM ph WHERE sitename LIKE '%".$quary."%' OR keywords LIKE '%".$quary."%' OR title LIKE '%".$quary."%' OR body LIKE '%".$quary."%' OR writtenby LIKE '%".$quary."%'";
while($row = mysql_fetch_array($result))
{
$post = substr($row['body'],$position,1); // Find what is the last character displaying. We find it by getting only last one character from your display message.
if($post !=" "){ // In this step, if last character is not " "(space) do this step .
// Find until we found that last character is " "(space)
// by $position+1 (14+1=15, 15+1=16 until we found " "(space) that mean character 20)
while($post !=" "){
$i=1;
$position=$position+$i;
$post = substr($row['body'],$position,1);
}
}
$post = substr($row['body'],0,$position); // Display your message
print $row['sitename'];
echo "<br/>";
echo $post;
echo "...";
echo "<br/><br/>";
}
?>
<?=$pagination?>
However for some reason when I type run the following "Development Blog" in q=Development Blog i get this error
Fatal error: Maximum execution time of 90 seconds exceeded in /home/example/public_html/search.php on line 202
In the ph table the column sitename has the word Development Blog, however I am getting that time out error, can any one help?
|
|
|
|