jakebur01 Posted August 15, 2007 Share Posted August 15, 2007 Is their any way to speed this up? <?php $db = mysql_connect("localhost", "1", "1"); mysql_select_db("1", $db); $result = mysql_query("SELECT isbn, description, title, author FROM books "); // WHERE catid <> 'TBP' while($myrow = mysql_fetch_array($result)) { $catid = $myrow['isbn']; $title = $myrow['isbn'].' '.$myrow['description'].' '.$myrow['title'].' '.$myrow['author']; $url = "show_book.php?isbn=$catid"; //echo "<small>"; //echo $myrow['isbn'].' '.$myrow['description'].' '.$myrow['title'].' '.$myrow['author']; ?> <a href="<?php echo $url; ?>"><?php echo $title; ?></a><br /> <?php } ?> Quote Link to comment https://forums.phpfreaks.com/topic/65001-speed/ Share on other sites More sharing options...
NArc0t1c Posted August 15, 2007 Share Posted August 15, 2007 What do you mean by speed? Try using less variables. <?php $connection = mysql_connect("localhost", "1", "1"); mysql_select_db("1", $connection); $result = mysql_query("SELECT isbn, description, title, author FROM books"); // WHERE catid <> 'TBP' while($myrow = mysql_fetch_array($result)) { echo '<a href="show_book.php?isbn=' . $myrow['isbn'] . '">' . $myrow['isbn'].' '.$myrow['description'].' '.$myrow['title'].' '.$myrow['author'] . '</a><br /> } ?> Maybe that will make it about a few micro seconds faster. This is a little script so really.. Quote Link to comment https://forums.phpfreaks.com/topic/65001-speed/#findComment-324404 Share on other sites More sharing options...
jakebur01 Posted August 15, 2007 Author Share Posted August 15, 2007 PHP Fatal error: Maximum execution time of 15 seconds exceeded I have a table with about 40 or 50 thousand items. I was trying to speed it up as much as I can. Quote Link to comment https://forums.phpfreaks.com/topic/65001-speed/#findComment-324408 Share on other sites More sharing options...
NArc0t1c Posted August 15, 2007 Share Posted August 15, 2007 heh, keep trying. You need server power here.. Quote Link to comment https://forums.phpfreaks.com/topic/65001-speed/#findComment-324418 Share on other sites More sharing options...
gurroa Posted August 15, 2007 Share Posted August 15, 2007 Try adding <?php ini_set('max_execution_time', 300); // this should gave you more time ob_start(); // this should speed up outputing data Quote Link to comment https://forums.phpfreaks.com/topic/65001-speed/#findComment-324426 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.