lucas20042004 Posted June 19, 2008 Share Posted June 19, 2008 Hi, my site was working ok yesterday but today it is coming up with this error: Fatal error: Maximum execution time of 30 seconds exceeded in /xxxxxx/library/classes/class_db.php on line 31 The class_db.php file is below. I hope somebody can help. Thanks <?php class db { var $totalquerys=0; function connect($sqlhost, $sqluser, $sqlpass){ $db=mysql_connect($sqlhost, $sqluser, $sqlpass) or die("Cant connect to Database!"); return $db; } function select_db($sqldb){ mysql_select_db($sqldb) or die("Cant select Database"); $this->totalquerys++; } function query($sqlquery){ $result=mysql_query($sqlquery); if(empty($result)){ $sqlerror = mysql_error(); $line = __LINE__; echo "<b>MySQL Returned Error:</b><br/><textarea rows=10 cols=40>$sqlerror</textarea><br />on Line: $line<br /><br /><b>Query:</b><br /><textarea rows=10 cols=40>$sqlquery</textarea>"; exit(); } $this->totalquerys++; return $result; } function qfetch($sqlquery){ $result=mysql_query($sqlquery); if(empty($result)){ $sqlerror = mysql_error(); $line = __LINE__; echo "<b>MySQL Returned Error:</b><br/><textarea rows=10 cols=40>$sqlerror</textarea><br />on Line: $line<br /><br /><b>Query:</b><br /><textarea rows=10 cols=40>$sqlquery</textarea>"; exit(); } $row=mysql_fetch_assoc($result); return $row; } function fetch($result){ $row=mysql_fetch_assoc($result); return $row; } function num_rows($result){ $rows=mysql_num_rows($result); return $rows; } function qnum_rows($fieldlist, $table, $field="", $value="", $operator="="){ if(!empty($field)&&!empty($value)) echo "SELECT " . $fieldlist . " FROM sf_" . $table . " WHERE " . $field . " " . $operator . " '" . $value ."'"; if(!empty($field)&&!empty($value)) $result = $this->query("SELECT " . $fieldlist . " FROM sf_" . $table . " WHERE " . $field . " " . $operator . " '" . $value ."'"); else $result = $this->query("SELECT $fieldlist FROM sf_$table"); $rows = $this->num_rows($result); return $rows; } function close($conn){ mysql_close($conn); } } $db=new db; ?> Link to comment https://forums.phpfreaks.com/topic/110901-fatal-error-maximum-execution-time-of-30-seconds-exceeded/ Share on other sites More sharing options...
klpang Posted June 19, 2008 Share Posted June 19, 2008 Try to increase max_execution_time in your php.ini. It will solve the issue. ;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;; max_execution_time = 60 ; Maximum execution time of each script, in seconds Link to comment https://forums.phpfreaks.com/topic/110901-fatal-error-maximum-execution-time-of-30-seconds-exceeded/#findComment-568954 Share on other sites More sharing options...
bluejay002 Posted June 19, 2008 Share Posted June 19, 2008 Try to increase max_execution_time in your php.ini. It will solve the issue. ;;;;;;;;;;;;;;;;;;; ; Resource Limits ; ;;;;;;;;;;;;;;;;;;; max_execution_time = 60 ; Maximum execution time of each script, in seconds yes, defintely. but if you want to override that, you can use set_time_limit(); cheers, Jay Link to comment https://forums.phpfreaks.com/topic/110901-fatal-error-maximum-execution-time-of-30-seconds-exceeded/#findComment-568958 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.