Re: why so slow?
| From: | Mel | Date: | Wed, 01 Nov 2006 10:35:54 +0000 |
| Subject: | Re: why so slow? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-244003@lists.php.net to get a copy of this message | ||
Here is the code for a testing page: http://www.squareinch.net/client_testing.php?art=btw_logo.jpg
I am sure it is a mess since it is my first!!!
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle" bordercolor="#FFFFFF"><!-- ************************* start header --> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>SQUARE INCH</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <meta name="KeyWords" content="Square Inch, Graphic Design, Logo Design, Website Design, Corporate ID"> <link href="http://www.squareinch.net/sq.css" rel="stylesheet" type="text/css"> </head> <body> <!-- ************************* end header --> <table width="1005" height="579" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="213" height="289"> </td> <td width="289" class="navbox1"> <!-- ************************* start navcli/box 1 --> <?php include("http://www.squareinch.net/include/misc.inc"); /* connect to server */ $connection = mysql_connect($host,$user,$password)
or die ("couldn't connect to server");
/* connect to database */
$db = mysql_select_db($database,$connection)
or die ("Couldn't select database");
/* query 1 from client */
/* the "mysql_query" function gets the data requested by the "select"*/
$query = "SELECT * FROM client
where status='active' or status='old'
order by companyName";
/* The variable "$result" holds the result of the select query */
$result = mysql_query($query)
or die ("Couldn't execute query");
/* function: mysql_fetch_array */
/* the while loop creates a line of information for each item found by the select query */
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) /* array variable=$row */
{
/* display one row for each company */
/* display Company Name then display an arrow */
echo "<span class='navCompany'>{$row['companyName']}</span><span class='navArrow'> > </span>\n";
/* query 2 from job */
$query = "SELECT * FROM job
WHERE companyId='{$row['companyId']}'";
$result2 = mysql_query($query)
or die ("Couldn't execute query2");
$jobsdone = mysql_query($result2);
/* for each jobType show the jobtype and link to the image*/
foreach($row as $jobType)
{
$row = mysql_fetch_array($result2,MYSQL_ASSOC); /* array variable=$row */
echo "<span class='navText'><a href=client_testing.php?art=".$row['pix']." border='0'>{$row['jobType']}</a></span>\n";
}
/* start a new line for each company */
echo "<br>";
}
?>
<!-- ************************* end navcli/box 1 -->
</td>
<td width="289" class="navbox2">
<!-- ************************* start logo/box 2 -->
<img src="http://www.squareinch.net/images/sq_logo_137.gif" width="137" height="137">
<!-- ************************* end logo/box 2 -->
</td>
<td height="289" valign="bottom">
</td>
</tr>
<tr>
<td width="213" height="289"> </td>
<td class="navbox3"><!-- ************************* start art/box 3 --> <?php $image = $_GET['art']; ?> <span class="pix"><img src="images/<?php print ($image) ?>" border="0" width="273" height="273"></span> <!-- ************************* end art/box 3 --> </td> <td class="navbox4"> <!-- ************************* start info/box 4 --> <?php $query = "SELECT * FROM client where status='active' or status='old' order by companyName"; $result = mysql_query($query) or die ("Couldn't execute query"); while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) { /* query 2 from job */ $query = "SELECT * FROM job WHERE companyId='{$row['companyId']}'"; $result2 = mysql_query($query) or die ("Couldn't execute query2"); $url = mysql_query($result2); foreach($row as $url) { $row = mysql_fetch_array($result2,MYSQL_ASSOC); if ("url={$row['url']}") echo "<span class='navText'><a href={$row['url']}>{$row['url']}</a></span>\n"; } echo "<br>"; } ?> <!-- ************************* end info/box 4 --> </td> <td width="213" height="289"> </td>
</tr></table> </td> </tr> </table> </body> </html> On Nov 1, 2006, at 2:10 AM, Frank Arensmeier wrote:
Please send a CC of your answer to the PHP list as well... /frank Vidarebefordrat brev:Från: "Toby Osbourn" <toby.osbourn@googlemail.com> Datum: onsdag 1 nov 2006 10.57.17 GMT+01:00 Till: "Frank Arensmeier" <frank.arensmeier@nikehydraulics.se> Ämne: Re: [PHP] why so slow? Yeah it will be that hit counter or whatever it is you are trying to load - I had one myself that used JS and was hosted on another website and held up the page it was on by a good 3-4 seconds, and that was on a good day. On 01/11/06, Frank Arensmeier <frank.arensmeier@nikehydraulics.se> wrote: Maybe it's the 18 k of JavaScript from Google that slows your page down? Why not load this script locally from your server? /frank 1 nov 2006 kl. 10.26 skrev Mel:So do you mean that's it is ok and not slow? On Nov 1, 2006, at 1:09 AM, Robert Cummings wrote:-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpguessingOn Wed, 2006-11-01 at 00:55 -0800, Mel wrote:Could you think of why my site loads so slowly? http://www.squareinch.net/home.phpThat's a bit like asking us to read your mind. We'd only besitesince we can't see your code and you haven't told us what yourdoes. What I can say is that it's probably not reverse DNS since my first page load was about 8 seconds, my second was about .5 seconds, and my third was about 6 seconds. Cheers, Rob. -- .------------------------------------------------------------. | InterJinn Application Framework - http://www.interjinn.com | :------------------------------------------------------------: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn || also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. |`------------------------------------------------------------'-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --http://www.borninblood.co.uk