Tag : Trigger



Example of trigger on after delete with update query mysql

Sometimes we need to fire trigger like after delete update some fields of another tables. for example if you have chat_message tables and when remove row on this table then we need to update "remove_counter(remove_counter + 1)" on users table. i did give you bellow example you can see how to write trigger code: <strong class="example">Example:</strong> <pre class="prettyprint lang-php"> delimiter // CREATE TRIGGER add_ban_counter_in_users AFTER DELETE ON `chat_messages` FOR EACH ROW BEGIN UPDATE `users` SET remove_counter = users.remove_counter + 1 WHERE users.id = old.user_id.....

By Hardik Savani | April 5, 2016 | | 2110 Viewer | Category : PHP MySql SQL
READ MORE

    Laravel 5.2 API using JWT authentication tutorial from scratch example

    Laravel 5.2 API using JWT authentication tutorial from scratch example

    Open Post

    AngularJS - Display Default image if original image does not exists with example

    AngularJS - Display Default image if original image does not exists with example

    Open Post

    Laravel 5 - Example of Database Seeder with insert sample data

    Laravel 5 - Example of Database Seeder with insert sample data

    Open Post

    Bootstrap multiselect dropdown in popup using popupMultiSelect plugin

    Bootstrap multiselect dropdown in popup using popupMultiSelect plugin

    Open Post

    How to upload image with validation in PHP Codeigniter?

    How to upload image with validation in PHP Codeigniter?

    Open Post

    Laravel 5 custom pagination view example

    Laravel 5 custom pagination view example

    Open Post