Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
එක පැකේජ් එකයි මාසෙටම Unlimited Internet. තාමත් DATA CARD දාන්න සල්ලි වියදම් කරනවද? අඩුම මිලට අපෙන්.
sayuru bandara
Updated:
Tuesday at 12:30 PM
Ad icon
ඉන්ටර්නෙට් එකෙන් හරියටම සල්ලි හොයන්න සහ Success වෙන්න කැමතිද? 🚀 (E-Money & Success Stories)
siri sumana
Updated:
Saturday at 11:44 PM
Gemini AI PRO 18 months Offer
Hawaka
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Ad icon
koko account
DasunEranga
Updated:
May 27, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
MySQL Trigger Automatic Update
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="geeko" data-source="post: 29074065" data-attributes="member: 465247"><p>Code eka change kale. meken trigger eka hadanna puluwan error ekak enne na. eth awashya de venne na</p><p></p><p>DELIMITER $$</p><p></p><p>CREATE TRIGGER update_winner_trigger AFTER UPDATE ON oc_t_item_meta </p><p>FOR EACH ROW </p><p>BEGIN</p><p> -- Update winner based on the specified conditions</p><p> UPDATE oc_t_auction AS a </p><p> JOIN oc_t_item AS i ON a.item_id = i.pk_i_id </p><p> SET a.winner = </p><p> CASE </p><p> WHEN (</p><p> (SELECT m1.s_value FROM oc_t_item_meta AS m1 WHERE m1.fk_i_item_id = NEW.fk_i_item_id AND m1.fk_i_field_id = 16) > UNIX_TIMESTAMP()</p><p> AND</p><p> (SELECT m2.s_value FROM oc_t_item_meta AS m2 WHERE m2.fk_i_item_id = NEW.fk_i_item_id AND m2.fk_i_field_id = 15) >= a.bidding_price</p><p> ) THEN 1 </p><p> WHEN i.dt_expiration > UNIX_TIMESTAMP() AND (SELECT m2.s_value FROM oc_t_item_meta AS m2 WHERE m2.fk_i_item_id = NEW.fk_i_item_id AND m2.fk_i_field_id = 15) >= a.bidding_price THEN 1 </p><p> ELSE 0 </p><p> END </p><p> WHERE a.item_id = NEW.fk_i_item_id;</p><p>END;</p><p>$$</p><p></p><p>DELIMITER ;</p></blockquote><p></p>
[QUOTE="geeko, post: 29074065, member: 465247"] Code eka change kale. meken trigger eka hadanna puluwan error ekak enne na. eth awashya de venne na DELIMITER $$ CREATE TRIGGER update_winner_trigger AFTER UPDATE ON oc_t_item_meta FOR EACH ROW BEGIN -- Update winner based on the specified conditions UPDATE oc_t_auction AS a JOIN oc_t_item AS i ON a.item_id = i.pk_i_id SET a.winner = CASE WHEN ( (SELECT m1.s_value FROM oc_t_item_meta AS m1 WHERE m1.fk_i_item_id = NEW.fk_i_item_id AND m1.fk_i_field_id = 16) > UNIX_TIMESTAMP() AND (SELECT m2.s_value FROM oc_t_item_meta AS m2 WHERE m2.fk_i_item_id = NEW.fk_i_item_id AND m2.fk_i_field_id = 15) >= a.bidding_price ) THEN 1 WHEN i.dt_expiration > UNIX_TIMESTAMP() AND (SELECT m2.s_value FROM oc_t_item_meta AS m2 WHERE m2.fk_i_item_id = NEW.fk_i_item_id AND m2.fk_i_field_id = 15) >= a.bidding_price THEN 1 ELSE 0 END WHERE a.item_id = NEW.fk_i_item_id; END; $$ DELIMITER ; [/QUOTE]
Insert quotes…
Verification
Dawasata paya keeyak thibeda?
Post reply
Top
Bottom