Freelancers Network
 
skill list top cap
Homepage
Join the Freelancer's Network
Update your details
Find a freelancer
Post a project
Find a project
Projects Archive
Post a job
Find a job
Jobs Archive
See Dan's Pages
See Andy's Pages
Link to this site
Resources
Join/Leave Forum
Forum Messages
+Additions+ Adverts
Advertising
Contact Us
Subscribe to our newsletter - enter your email address and hit return
Freelancers.net is owned and operated by Andy Stowell and Dan Winchester
skill list end cap
guru web hostcom

Find me again on Freelancers.net

FN-FORUM: mySQL/php question

date posted 27th February 2008 22:48

Hi all,

Maybe a bit late in the day to ask this one, but I have a question about a
php function that I had made up for me to copy some Joomla DocMan content to
Virtumart, thing is that the tables are now pretty big and the script is
becoming extremely slow and tends to time out.

I know I could increase the script processing time but I'm hoping I have an
alternative, I've pasted the function below and was hoping someone could
point me in the right direction so that rather than going through every
record (which is why its taking so long) can I modify the code to start
processing from a specific record ID, in this way I'm hoping that the
process will be a lot quicker, and once a week I can modify the script so
that things run smoothly - not exactly ideal I know, but I am getting a new
component built which will automate all this but its gonna take a couple of
months probably.

Anyway, if anyone can help me out I'd be grateful.

Thanks in advance

Allan


function pruneVm() {

global $database;

$sql = "SELECT * FROM #__docman d";
$database->setQuery($sql);
$doc = $database->loadObjectList();
$k=0;
for($i=0;$iid."'";

$database->setQuery($sql);

$product_id = $database->loadResult();

if(!$product_id) {

saveToVm($doc[$i]);
$k++;

}

}
mosRedirect("index2.php?option=com_docman§ion=documents", "$k
document(s) copied to virtue mart");
exit;


}




Messages by Day
February 29th 2008
February 28th 2008
February 27th 2008
February 26th 2008
February 25th 2008
February 24th 2008
February 23rd 2008
February 22nd 2008
February 21st 2008
February 20th 2008
February 19th 2008
February 18th 2008
February 17th 2008
February 16th 2008
February 15th 2008
February 14th 2008
February 13th 2008
February 12th 2008
February 11th 2008
February 10th 2008
February 9th 2008
February 8th 2008
February 7th 2008
February 6th 2008
February 5th 2008
February 4th 2008
February 3rd 2008
February 2nd 2008
February 1st 2008


Messages by Month
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008


Messages by Year
2008
2007
2006
2005
2004
2003
2002
2001
2000