in reply to database not in correct order
E.g. the first record would have a posttime that is (roughly) when the service began, the last record from the DBM file would be set to the time when the DBM file was phased out, and all intermediate records would have values that differ by a regular increment ((end_time - begin_time)/(record_count+2) would probably suffice).
I gather from one of your other replies that the DBM file does not include posttime values, but that as new posts are added to the mysql table, these values will be properly stored. So just be sure that the "pseudo" posstime values that you make up for the old data do not overlap with the "true" values being generated by the ongoing collection.
BTW, shouldn't posttime values include a date as well as hours:minutes:sec?
UPDATE: A couple other points I forgot to notice/mention: First, it looks like you actually do have key values in the DBM file that, when sorted, produce the desired ordering. What kind of string makes up a key value? Can that string be reasonably converted into some sort of time expreassion for use as the "posttime" value?
Second, if you have a lot of records to insert, you'll want to move the "prepare()" statement outside the foreach loop -- you are already using placeholders, so you might as well use them as they were intended to be used: prepare once, execute many times with different values passed in each iteration of the execute call.
|
|---|