/    Sign up×
Community /Pin to ProfileBookmark

Php and Mysql Trigger Question

I know how to call stored procedure on php. I am not familiar with trigger. But with trigger can php and trigger interact? Let say you run an sql query on php, can you also run trigger after the sql query on php have been run?

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@arrielmabaleSep 07.2010 — You can still execute php scripts after the sql runs and check which are affected, dont give too much load on your sql give some to you php scripts ^_^
Copy linkTweet thisAlerts:
@anishgiriauthorSep 07.2010 — Thanks for the response.
Copy linkTweet thisAlerts:
@ht1815Sep 07.2010 — Triggers are like stored procedures, but they're run when an event occurs on the database, rather than on demand. They're "triggered" by events, hence the name. So, PHP and triggers don't interact directly. Rather, PHP code interacts with the database, causing an event, which will then run a trigger.

For example, you could write a trigger to run a piece of code every time a record is inserted into a particular table. You insert the record with your PHP code, which causes the database to invoke the trigger. But, you don't run the trigger directly with PHP.
×

Success!

Help @anishgiri spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...