Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8916667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:17:55+00:00 2026-06-15T05:17:55+00:00

I’m on local machine. I only get that error when loading the page the

  • 0

I’m on local machine. I only get that error when loading the page the first time after an insert|create|delete. Then it loads very fast. Then again if I modify the database, the first time(sometimes the second time) when accessing the page i get that error.
I don’t get it.

Why do i get that error only the first time when I access the site after modifying the database?

$sth = $this->dbh->prepare("SELECT g.t_tree_c_parent AS gp ,h.t_tree_c_parent AS hp
                FROM t_tree a INNER JOIN (t_data b, t_data c, t_tree d, t_data e, t_data f, t_tree g, t_tree h, t_tree i) 
                ON a.t_tree_c_child=b.t_data_c_space
                AND b.t_data_c_object=c.t_data_c_object
                AND c.t_data_c_space=d.t_tree_c_child
                AND d.t_tree_c_parent=e.t_data_c_object
                AND e.t_data_c_space=f.t_data_c_object
                AND f.t_data_c_space=g.t_tree_c_child
                AND g.t_tree_c_parent=h.t_tree_c_child
                AND e.t_data_c_space=i.t_tree_c_child
                AND i.t_tree_c_parent=?
                WHERE a.t_tree_c_child=?");
$sth->execute(array($this->glob['children'], $child)); //  <- LINE:183

I will split that query to test out. But I’m asking maybe I’m missing something.

UPDATE asked by @jcho360:

CREATE TABLE `t_data` (
`t_data_c_space` VARCHAR(50) NOT NULL DEFAULT '0.00000000000',
`t_data_c_object` VARCHAR(50) NULL DEFAULT NULL,
`t_data_c_timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`t_data_c_space`)
 )
COLLATE='utf8_general_ci'
ENGINE=InnoDB;

CREATE TABLE `t_tree` (
`t_tree_c_parent` VARCHAR(50) NOT NULL,
`t_tree_c_child` VARCHAR(50) NOT NULL,
`t_tree_c_timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;

In HeidiSQL for a child(in project this query is in a recursive function):

2.137 sec the first time after a small update in db then 0.000 sec

I start to think that is the mysql caching, sugested by Leandro Barreto.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T05:17:57+00:00Added an answer on June 15, 2026 at 5:17 am

    I will give you a wild guess here: Database caching.

    On the first time you execute the page, the query is not cached in the database, so, it takes longer, thus, expiring PHP’s time limit.

    On the other times, the query is much faster.

    You can either split the query, as you mentioned, or you could try increasing the time limit on the script:

    set_time_limit(0); //No time limit
    set_time_limit(60); //60 seconds
    

    To be sure, you could use this to clean database cache and use it always sou you will always run the page on clean cache.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to create an if statement in PHP that prevents a single post
I'm making a simple page using Google Maps API 3. My first. One marker
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.