I'm learning php and Mysql , i'm copy script for teaching from project professional book whatever when running this script : <?php $host="localhost"; $dbusername="root"; $dbpassword="root"; $database="books"; $x=mysql_connect("localhost","root","root") or die(mysql_error());
$x2=mysql_select_db($books);
if (empty ($category)) { $category=1; } $childval=$category; $query = "Select categoryid,name from categroy where categoryid=\"".$childval."\""; $result=mysql_query($query); if ($row=@mysql_fetch_array($result)) { } while (!($childval==0)) { $query="select parentcategoryid from category where categoryid=\"".$childval."\""; $result=mysql_query($query); if ($row=@mysql_fetch_array($result)) { $query="select categoryid,name from category where categoryid=\"".$childval."\""; $result=mysql_query($query); if($row=mysql_fetch_array($result)) { } } }
for ($i=count($catname);$i>0;$i) { } ?> The problem appears :Fatal error: Maximum execution time of 180 seconds exceeded in C:\AppServ\www\project.php on line 32
Should be the cause.
Hello,
Increase your php.ini max_execution_time from 180 to 300 seconds and restart your Appserv. See if that helps