Code: Select all
<?php
session_start();
$con = mysql_connect("","root",""); // here localhost and password will be filled accordingly
if (!$con)
{
die('Connection failure: ' . mysql_error());
}
mysql_select_db("student",$con);
$fetch=mysql_query("SELECT * from student1") or die(mysql_error());
$row = mysql_fetch_array($fetch) or die(mysql_error());
sleep(10);
echo "Name: ".$row[0]."</br>";
echo " Age: ".$row[1]."</br>";
echo " Address: ".$row[2];
mysql_close($con);
?>Now the problem is if i load the file woth sleep function first then its delayed nature is reflected in another file which is without sleep() i.e now the file without sleep is taking longer time to open.
plz explain all this and possible solution to this problem
Localhost database connectivity and record retrieval all working fine
i mean when you open the file with sleep() in browser and then refresh the file without sleep() function then the file without sleep() function takes longer time to open