Hello everyone,
I have 2 MySQL tables called ANNOUNCEMENT1, and ANNOUNCEMENT2
CREATE TABLE ANNOUNCEMENT1(
  AnnouncementID bigint(20) unsigned DEFAULT '0' NOT NULL,
  Title varchar(250),
  DatePosted date DEFAULT '0000-00-00' NOT NULL,
  Content text,
  ArchiveDate date,
  DateShown date DEFAULT '0000-00-00' NOT NULL,
  IsArchived tinyint(3) unsigned DEFAULT '0' NOT NULL,
  IsFeatured tinyint(3) unsigned DEFAULT '0' NOT NULL,
  FeaturedDate date,
  IsActive tinyint(3) unsigned DEFAULT '0' NOT NULL,
  Hits bigint(20) unsigned DEFAULT '0' NOT NULL,
  Votes bigint(20) unsigned DEFAULT '0' NOT NULL,
  KEY AnnouncementID (AnnouncementID),
  KEY ID (AnnouncementID)
);
CREATE TABLE ANNOUNCEMENT2(
  AnnouncementID bigint(20) unsigned DEFAULT '0' NOT NULL,
  Title varchar(250),
  DatePosted date DEFAULT '0000-00-00' NOT NULL,
  Content text,
  ArchiveDate date,
  DateShown date DEFAULT '0000-00-00' NOT NULL,
  IsArchived tinyint(3) unsigned DEFAULT '0' NOT NULL,
  IsFeatured tinyint(3) unsigned DEFAULT '0' NOT NULL,
  FeaturedDate date,
  IsActive tinyint(3) unsigned DEFAULT '0' NOT NULL,
  Hits bigint(20) unsigned DEFAULT '0' NOT NULL,
  Votes bigint(20) unsigned DEFAULT '0' NOT NULL,
  TrueFlag tinyint(3) unsigned DEFAULT '0' NOT NULL,
  KEY AnnouncementID (AnnouncementID),
  KEY ID (AnnouncementID)
);

Here is what I want to do:
1. Create announcements in ANNOUNCEMENT1 table:
WHat I do is basically create the announcement, and when I go to save it, I
save it to both tables with the same ID number (The ID numbers are generated
on the fly)

2. At this point, I can go and edit each table by itself. If I never edit
ANNOUNCEMENT2, TrueFlag is by default=0
However, if I do edit it, the program automatically sets to 1.

2. Next, I want to be able to edit these 2 tables depending on the flag
(TrueFlag)

A. If I go to edit ANNOUNCEMENT1, I want to look at the TrueFlag in
ANNOUNCEMENT2. If TrueFlag=0, the UPDATE overrights both tables.
If TrueFlag=1, then I just want to overright some of the fields and not all
of them.
For example, when updating ANNOUNCEMENT1, I want to update the following
fields in ANNOUNCEMENT2:
  DatePosted
  ArchiveDate
  DateShown
  IsArchived
  IsFeatured
  FeaturedDate

and leave the rest as there were!

Any ideas?

Thanks so much,
Soheil




---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to