Jump to content

Need help writing this one...


AV1611

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
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.