Jump to content

Archived

This topic is now archived and is closed to further replies.

AV1611

Need help writing this one...

Recommended Posts

Need some suggestion on how to write this script... (PHP/MySQL)

let me describe the table:

(field names - example)

partnumber - 1122.123
compliant - YES
mfg1 - AMD
mfg1pn - 74hc123
compliant1 - n
mfg2 - AMD
mfg2pn - 74hc123
compliant2 - y
mfg3 - AMD
mfg3pn - 74hc123
compliant3 - n

there is a second table called archives

partnumber - 2222.123
mfg - AVX
mfgpn - 1N123
compliant - n

----------------

OK,

what the script needs to do is first select all the records that have compliant = YES

then it needs to move all mfgx/mfgpnx/compliantx triplets to the archive table IF the compliantx=n

so,

when it is finished, all records where compliant = YES have ONLY compliant mfgx/mfgxpn/compliantx=y
AND
all records that have compliant != YES have no change.

sounds easy, until you go to write it...


You should know the tables above are simplified, actually, there are 5 triplets per record, and about 30 fields, but I can sort all that out...

Thanks

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.