Slow query in MySQL and PHP causing a delay in execution time that has been exceeded

I am facing an issue with fetching records from my 20 tables which each contain over 5000 records. The data fetching process is extremely slow and instead of displaying the data, I am getting the following error:

Fatal error: Maximum execution time of 30 seconds exceeded

This error originates in PHP within the query below:

"$query1 = "SELECT employees.*,upgradations.EmpID, upgradations.BPZ,picture.PicPath , designation.Designat FROM upgradations,employees,picture,designation WHERE upgradations.Designationz=designation.Code AND upgradations.UPStatus=1 AND picture.EmpID=employees.EmpID AND upgradations.EmpID=employees.EmpID AND employees.DEntry='$UCNIC' ORDER BY employees.ID ASC LIMIT $start, $limit ";"

Answer №1

To prevent hitting the maximum execution time in your php.ini file, you can increase it by adjusting the following code:

 ini_set('max_execution_time', 300); //300 seconds = 5 minutes

Answer №2

To set the maximum execution time in php.ini file:

1. Look for the ini_set function

2. Update it to the following code:

ini_set('max_execution_time', 1000); //Setting max execution time to 1000 seconds

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

"Delving into the intricacies of CakePHP: Efficiently managing

Imagine a scenario where two models are associated, with the main model having a hasMany relationship with the other model. For example, Donor hasMany Donations. After carefully studying CakePHP's documentation, I came across this important note: " ...

Sending JSON data to PHP using AJAX request

Currently attempting to send textbox values to a database via JSON and .getJSON. I am currently testing whether the JSON is successfully posting to the page, as I have confirmed that the UPDATE query is functioning correctly... The following code is not a ...

How can I pass a JavaScript variable to PHP in order to modify the filename of an uploaded file?

How can I modify the filename for the file upload to include an ID prefix? For example: Let's say I have the ID stored in a JavaScript variable called item_id. Is it possible to add data to data.append and use that in the "upload.php" file? I woul ...

Can PHP be utilized to convert an XML file to UTF-8 encoding?

I have encountered an XML document that is encoded in ITF-16 LE, making it unreadable in wp all import. Upon investigating the version section, I found this: <?xml version="1.0" encoding="Unicode" ?> Additionally, in my visual studio code, I notice ...

Laravel's implementation of a virtual table

I am looking to convert my SQL query into Laravel Eloquent. The SQL query in question is as follows: select distinct receiver from ( select u.user_id as receiver, max(created_at) as created_at from messages m join message_user u on m.id = u.message_id w ...

What is preventing me from submitting this array to PHP?

I am currently facing an issue with my table data and checkboxes. Initially, I was able to extract the id of each selected item upon checkbox click and receive it in PHP when submitting. However, I have now decided to change my approach and submit the enti ...

Basic use of AJAX for sending the value from jQuery's datepicker

As a novice in JavaScript and AJAX, I'm hoping for your patience as I navigate my way through. In the scope of this project, I am utilizing the CodeIgniter framework. My objective is to implement a datepicker and transmit its value via AJAX. Below is ...

Having difficulty utilizing WP_Query effectively for accomplishing certain tasks

Currently, I am diving into the world of WordPress theme development by adapting my existing Bootstrap and JavaScript website. My requirements are as follows: 1) Implement a section on the homepage of my WordPress site to display the latest three blog ar ...

Is it possible to send emails from a local server to Gmail, Yahoo, or Rediff?

Currently, I am developing a feature that allows users to send emails to any recipient including Yahoo and Gmail. Below is the code snippet for my contact form: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1 ...

Steps to Safely Transmit the Password through Ajax() Function in jQuery

I have implemented a Password textbox that starts with an empty value. When the user clicks on it and enters a password, the password will be updated in the database upon leaving the textbox (onblur event). I have successfully achieved this using ajax(). H ...

Performing an array selection in NodeJS using SQL commands

I am currently dealing with an array containing results = ['5', '2', '11', '12', '4']. My goal is to create a SQL query that will count the number of rows in a selection based on this array, essentially usi ...

What is the best way to retrieve data using AJAX jQuery after clicking on text?

I recently used this code to send and retrieve results. <script type="text/javascript"> $(document).ready(function() { $('.special').click(function(){ var info = $(this).attr("rel"); //$(this).html(sku) ...

Sending PUT and DELETE requests in a Laravel application hosted on a shared server

I have developed a unique Laravel CMS application that is functioning perfectly on my local environment. Now, I am attempting to deploy it on a shared hosting server. To achieve this, I have organized all Laravel app files and folders (excluding public) i ...

Why is my PHP json_decode function returning null?

I have spent countless hours searching on various platforms like Google and Stack Overflow, but unfortunately, I haven't been able to find a suitable solution for my problem. The issue lies with the JSON data that is being retrieved from the database ...

What are alternative methods for reading JSON files in PHP that do not involve file_get_contents()?

Recently, I developed a basic PHP script that fetches data from a local JSON file and uses it to respond to various queries directed at the page. In my implementation, I adopted the usage of file_get_contents() for reading the file. However, as the number ...

Exploring Laravel's recursive relationships feature and understanding the concept of returning $this

I am working on a navigation bar that contains industries with potentially unknown levels, including child industries. My goal is to create a recursive relationship to retrieve the top industry and display it as the main Category. The code snippet I attemp ...

What is the process for extracting information from numerous Google Analytics accounts with the Google API?

My web application allows users to grant offline access to their Google Analytics account. The issue I face is when trying to retrieve data from multiple Google Analytics accounts simultaneously. Despite updating the access token for each user, the data al ...

Displaying information stored in a database as notifications in the notification icon within the HTML/PHP header

Within my MySQL database, there exists a table named order_detail. This table is populated with values from my android app. I am looking to display the order_id as a notification in my admin panel, which is built using HTML/PHP. The attributes of the orde ...

Displaying a message for PHP login validation when the password is entered correctly

I have implemented a login page on my website using PHP. I want to show error messages if the username does not exist, if the password is incorrect, or if either field is left empty when validating the form. Most of my validation code works fine except f ...

Saving the subtracted value from a span into a cookie until the checkbox is unchecked - here's how to

I am working on a piece of code that includes numeric values within a span. When the checkbox is clicked, it subtracts 1 from the main value, essentially reducing the total value. How can I achieve this so that even after the form is submitted, the deducte ...