[thelist] fileopen v mysql_query was insert if select fails to find element

Alex Beston alex at deltatraffic.co.uk
Thu Nov 17 20:33:12 CST 2005


Thanks Hassan / Joshua

>As above, set a UNIQUE index on the field, but use INSERT IGNORE to
>convert duplicate-row-errors to warnings.
>  
>
Yes, that worked quite nicely; I guess whats its doing is overwriting 
whats already there.

Interestingly, when I take the info out of the sql and into array, it 
takes about 0.7 secs longer for the 110,000 entries than for the 0.8 
secs (average)  uptake straight from the file.

 I wonder if there were many people accessing the site for this 
function, whether fileopen would lose this speed and sql be a better way 
of populating an array.

 At the moment, Im assuming that for any number of users fileopen & 
fgets  is better than mysql_query & mysql_fetch_assoc. would this be 
correct?

A.



More information about the thelist mailing list