Jump to content

Fatal error: Maximum execution time of 60 seconds exceeded in...


Jarod

Recommended Posts

Fatal error: Maximum execution time of 60 seconds exceeded in C:\wamp\www\inc\lib\class.MySQL.php on line 24

 

I get this error on my page, I was testing if the function worked, and it doesn't apparently. This is the code I used:

 

This is the class.MySQL.php file

<?php
require_once( dirname(__FILE__) . '/class.dbComponent.php');
class MySQL extends dbComponent {
var $query;

function __construct() {
	// Connect to the database
	dbComponent::connectDB('localhost', 'root', NULL, 'jv_cms');
}

function select($table, $columns, $where=NULL, $orderby=NULL, $limit=NULL) {
	$etc = "";
	if($where != NULL) {
		$etc .= " WHERE $where";
	}
	if($orderby != NULL) {
		$etc .= " ORDER BY $orderby";
	}
	if($limit != NULL) {
		$etc .= " LIMIT $limit";
	}

	$this->query = "SELECT $columns FROM $table" . $etc;

	return mysql_query($this->query);
}
}
?>

 

And the code in the index.php file, which is where the problem is occuring: (ignore the php comment)

<?php 
include_once(dirname(__FILE__) . '/inc/lib/class.MySQL.php');
$mysql = new MySQL();
require_once('inc/header.php'); 
require_once('inc/sidebar.php');
?>
	<div id="entries">
		<div class="entry"> <!-- Entry #1 -->
			<div class="entry_name">This is an entry</div>
			<div class="entry_content">
				<p>
<?php
//$query = $mysql->select('jays_users', '*', NULL, 'ASC', '5');
while( $row=mysql_fetch_assoc($mysql->select('jays_users', '*')) ) {
	$username = $row['users_username'];
	echo $username . "<br />\n";
}
?></p>
			</div>
		</div>
		<div id="browse_entries"><a href="#" title="Browse news archive">Browse Archive</a></div>
	</div>
<?php require_once('inc/footer.php'); ?>

 

 

The problem is though, is that my page literally outputs like a thousand usernames, when there's only 1 row in the table, how is that possible?? How did it even like multiply the  query?  :wtf:

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.