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

  • Home
  • SEARCH
  • 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 7892751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:56:45+00:00 2026-06-03T06:56:45+00:00

I have a website scraping script that is storing data into few MySQL tables.

  • 0

I have a website scraping script that is storing data into few MySQL tables. The records in the main table are referred from the other ones. The script would need around 5 hours to be executed, but it always stops working after around 70 minutes (set_time_limit() is set ofc). I tried to run it from both browser and cron, the result was the same.

Since the script stops at a random time, it can lead to database inconsistency. The main table record can be stored, but not the subordinant tables records using mysql_insert_id() from the main one.

Is there any better way than to delete the last record from the main table and all the referring records to the row from the other tables when running the script?

  • 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-03T06:56:47+00:00Added an answer on June 3, 2026 at 6:56 am

    You could wrap all your queries for a given record in a transaction, and commit it at the end. That way, if the script dies partway through a set of queries, the changes will be rolled back and the data will be kept consistent.

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

Sidebar

Related Questions

I have a script that's scraping images from a website (4chan). It's having to
I have a website that has approx 1000 different strings in a mysql database
I'm running a bunch of scripts that are scraping data from a website. For
Background : With a Python Script, I scraping data (html) from a Website and
I'm currently scraping a website and have all the useful data I need, although
I have PHP scrapping script which fetches HTML table content from another website. The
I have a two tables. TABLE 1 has id(PRIMARY)|RANK|WEBSITE |ADDRESS This is filled with
So basically I have website that has names of cities that can be checked
I'm using jQuery. I have website feature that does an ajax search and returns
I have a website with friendly urls. I want all url´s that end with

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.