SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Dec 2008
    Posts
    111
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    from mysql trigger to mysql code

    Hi there

    On a webapp I've used trigger to auto populate some tables. Because using triggers isn't commonly allowed to the public web hosts, I'll like to implement the triggers functionality from php code.

    Do you have any advice about how can I do that?

  2. #2
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Just to make sure I am getting your point, PHP cannot cause your trigger to fire - that is an instruction "hardwired" and internalized within the Mysql engine - that is my understanding anyway.

    If your question is "how to you take the instructions in your triggers and have them run another way?" all I can suggest is that you

    1 replicate the instructions in SQL statements
    2 have PHP run those SQL statements when an event happens, and/or,
    3 have cron call upon PHP to run the script against a time schedule


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •