Jump to content

MySQL Triggers


shivi

Recommended Posts

Hi all

 

I\'m not sure if MySQL supports triggers, or the syntax...

but here\'s what I\'m trying to do:

when I delect a record from a table, I want to create an entry into another table with information about the item deleted, pulled from 2 tables (including the one where the delete occured): BidInfo and ItemInfo.

 

So so far I have this:

[php:1:0a2b991aad]

CREATE TRIGGER trigger AFTER DELETE

ON BidInfo FOR EACH ROW

EXECUTE PROCEDURE ( INSERT INTO BuyInfo SET

ItemID = \'ItemID from BidInfo for deleted row\',

Seller = \'UserID from ItemInfo for ItemID\',

Buyer = \'CurrBidder from BidInfo\',

MaxBid = \'CurrBid from BidInfo for deleted row\');

[/php:1:0a2b991aad]

 

I really don\'t know how to fill in what\'s in the quotes...all these tables are linked by ItemID, the primary key in each.

 

Can anyone help??

Shivi.

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.