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 7070459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:34:08+00:00 2026-05-28T05:34:08+00:00

I put together a simple script that pulls the product name, category name and

  • 0

I put together a simple script that pulls the product name, category name and product id from two tables. Then I take that data and use it to create a page title that’s better than what I currently have for SEO purposes. For some reason I didn’t think it would take as long as it’s taking to run. There are 7k products.

My hosting company does allow the creation of a custom php.ini so I was able to override the 30 second time limit and changed it to 6000. But still the script times out. So I thought my script my suck. 🙂

Below is the script. Is there a better way I could write this so it doesn’t time out? Or is what I’m trying to do just going to take some time and I need to write the script to do one category at a time?

<?php
// Make a MySQL Connection
mysql_connect("localhost", "myusername", "mypassword") or die(mysql_error());
mysql_select_db("mydatabase") or die(mysql_error());

$result = mysql_query("SELECT isc_products.prodcode, isc_products.prodname, isc_categories.catname FROM isc_products, isc_categories WHERE isc_products.prodcatids = isc_categories.categoryid") 
or die(mysql_error());


while($row = mysql_fetch_array($result)){
$pname = mysql_real_escape_string($row['prodname']);
$catname = mysql_real_escape_string($row['catname']);
$sitename = Sitename;
$prodcode = $row['prodcode'];
$result2 = mysql_query("UPDATE isc_products SET prodpagetitle = '$pname - $catname - $sitename' WHERE prodcode = '$prodcode'") 
or die(mysql_error());
}

?>

indexes http://www.threewestcreative.com/indexes.jpg

Thanks, your help is appreciated. 🙂

Thanks SO much everyone! I really appreciate the quick responses. I can’t believe I overlooked something so simple as running a direct query against the database (without php). Geez… Thanks again!

  • 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-05-28T05:34:09+00:00Added an answer on May 28, 2026 at 5:34 am

    Just run

    UPDATE isc_products
    INNER JOIN isc_categories ON isc_products.prodcatids = isc_categories.categoryid
    SET isc_products.prodpagetitle=CONCAT(isc_products.prodname,' - ',isc_categories.catname,' - $sitename');
    

    If it times out, your DB is fishy (missing indices?)

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

Sidebar

Related Questions

I've put together a pretty simple competition script - it's commented out below and
I'm trying to put together a simple RSS widget (for my wordpress blog) that
I've written a fairly simple script that will take elements (in this case, <p>
I just put together a small script for a team of users that collects
Right now I'm trying to put together something really simple, learn from it, and
I put together a simple drop-down navigation that expands when you hover over a
I want to (quickly) put a program/script together to read the fileset from a
I want to put together simple TCP server using Python and Twisted. The server
I've put together a simple form to highlight the concepts of dynamic forms. What
This simple Python method I put together just checks to see if Tomcat is

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.