Hi
I have some issues re a number of PHP/mySQL pages I have written and the amount of traffic that they are generating. The pages are on an internal (citrix) network and are assessed via a datacard. However the amount of data that is being moved is huge and I don’t understand why.
I am reasonable proficient in PHP and understand the principles of server side code but I could do with some clarification on the traffic issues.
Each page has to display data generated by a query. In some instances records are updated or even created. Below is a sample of the code I’m using (to populate a list box).
----------------------------------
<?php
// open connection
$con = @mysql_connect("localhost","root","") or die("Connection to mySQL failed");
mysql_select_db("myDB",$con) or die("Cannot Connect to db");
//build sql statement
$sqlArea = "select * from tab_areas order by AREName";
//execute sql
$resArea = mysql_query($sqlArea) or die(mysql_error());;
//run loop to get row values and build into option statement
while ($row=mysql_fetch_array($resArea)) {
$area=$row["AREName"];
$areaID = $row["AREArea_ID"];
$option_area.="<OPTION VALUE=".$areaID.">".$area."</option>\n";
}
mysql_close($con)
?>
…html
<select name="area">
<?php echo $option_area;?>
</select>
----------------------------------
So in the above example, if the table size of tab_areas is 16384kb does this mean that the amount of data that will be moved from the server to the browser, after the query is run, will be 16384kb plus the size of the page?
All help gratefully received