Jump to content


Need help writing this one...

  • Please log in to reply
No replies to this topic

#1 AV1611

  • Members
  • PipPipPip
  • Advanced Member
  • 997 posts

Posted 31 May 2006 - 02:53 PM

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



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


when it is finished, all records where compliant = YES have ONLY compliant mfgx/mfgxpn/compliantx=y
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...


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users