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:

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.