[UPHPU] filter XML content against database
Wade Preston Shearer
wadeshearer.lists at me.com
Sat May 2 10:20:17 MDT 2009
Quoting Wade Preston Shearer <wadeshearer.lists at me.com>:
> I have an XML file full of records that match records in a database.
> The XML file contains more records than in the database however. I
> need to read the XML file in, loop through the object, and print our
> each record. I need to filter the XML records by the records in the
> database however; meaning, I only want the records that are also in
> the database. The two ways I have thought to do this are:
>
> 1. Query the database on each loop to check if that record exists.
>
> 2. Create a comma-separated string of the ID all of the XML records
> and then query the database using the IN() function.
>
>
> Both see really inefficient. Can anyone suggest a better way?
I just thought of one other way:
I could read the XML into a temporary database table and then join
that against my real table.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2431 bytes
Desc: not available
Url : http://uphpu.org/pipermail/uphpu/attachments/20090502/8b10a7e7/smime.bin
More information about the UPHPU
mailing list