massive loop troubles
Posted: Sun May 21, 2006 6:43 am
I'm transferring databases, and rather than just export/import via mysql, I need to write scripts to manipulate data and then stick it in a while loop and import that way.
I'm having trouble when it comes to the posts that contain [ img ] bbcode tags. When they are parsed, I automatically resize the image using results from getimagesize() so it doesn't stretch my forums layout. This is causing me a couple problems.
#1, this is *really* slow. I have ~325,000 forum entries. I wouldn't mind it being slow except for problem #2
#2, it seems that the loop will get "stuck".. I presume trying to grab the size of an image that can't be found err errored or something. It seems it will stick on this entry trying to get the size, then.... for some odd reason, the loop will start over!
I know its trying to start over because I get an error of a duplicate key on my first ID in the table.
Does anyone have any recommendations or suggestions on what I should do?
How long does getimagesize() wait for a response from a remote server? What happens if it can't find the image? And why is my loop starting over?
About the first 100k entries are just plain text, before I added the bbcode functionality, and those all import fine and extremly quick like. So the problem occurs when I first start parsing the entries with the [ img ] tags.

I'm having trouble when it comes to the posts that contain [ img ] bbcode tags. When they are parsed, I automatically resize the image using results from getimagesize() so it doesn't stretch my forums layout. This is causing me a couple problems.
#1, this is *really* slow. I have ~325,000 forum entries. I wouldn't mind it being slow except for problem #2
#2, it seems that the loop will get "stuck".. I presume trying to grab the size of an image that can't be found err errored or something. It seems it will stick on this entry trying to get the size, then.... for some odd reason, the loop will start over!
I know its trying to start over because I get an error of a duplicate key on my first ID in the table.
Does anyone have any recommendations or suggestions on what I should do?
How long does getimagesize() wait for a response from a remote server? What happens if it can't find the image? And why is my loop starting over?
About the first 100k entries are just plain text, before I added the bbcode functionality, and those all import fine and extremly quick like. So the problem occurs when I first start parsing the entries with the [ img ] tags.