Trigger

Hello.
I need to create trigger that will run after select.

I wrote this


DROP TRIGGER IF EXISTS `article_after_select`;

DELIMITER $$

CREATE
    TRIGGER `article_after_select` AFTER SELECT ON `article` 
    FOR EACH ROW BEGIN
    /*SOME ACTION HERE*/	
END;
$$

DELIMITER ;

I need when article selected, update view count.
But I can’t create trigger for SELECT.

you’ll have to do it with your application language (php or whatever)

Okay r937.
I just don’t understand why it’s working for delete, update, insert but not for select.

because the syntax doesn’t allow it

[indent]excerpt from the mysql manual –

CREATE
    [DEFINER = { [I]user [/I]| CURRENT_USER }]
    TRIGGER [I]trigger_name trigger_time trigger_event[/I]
    ON [I]tbl_name [/I]FOR EACH ROW [I]trigger_stmt[/I]

trigger_event indicates the kind of statement that activates the trigger. The trigger_event can be one of the following:

INSERT: The trigger is activated whenever a new row is inserted into the table; for example, through INSERT, LOAD DATA, and REPLACE statements.

UPDATE: The trigger is activated whenever a row is modified; for example, through UPDATE statements.

DELETE: The trigger is activated whenever a row is deleted from the table; for example, through DELETE and REPLACE statements.[/indent]