Page 1 of 1
Hook setup
Posted: 2015-09-02 21:50
by gonzalo
I am new to both PHP and Mysql. I set up my tables in Appgini and came up with UPDATE statements that do what I need done in my tables (checked each one in PHPMYADMIN). I inserted the update statements in the Hooks files and when I try to go in the tables nothing happens. I know I am missing something - but what? I am just inserting update statements in the after insert, after update and after delete sections of the table hook file.
Re: Hook setup
Posted: 2015-09-03 22:43
by a.gneady
Would you post the hooks code you added please?
Re: Hook setup
Posted: 2015-09-09 20:28
by gonzalo
I came up with a series of update commands to update the status of the tools in the master database. One such update is:
update equip
join eqjob on equip.eqlkl = eqjob.job
set equip.stat = "Available"
where eqjob.home="Y" ;
It does what I need, but within Phpmyadmin. I haven't been able to figure out where and how in the Hooks files I need to insert the code. I have been successful in adding this code as a trigger, but the trigger mechanism is severely limited as to the number of updates you can do to a table (namely 1).
Re: Hook setup
Posted: 2015-09-10 19:21
by a.gneady
Hmm ... you need to pass your update query inside a call to sql() if you are placing it in the after_insert and/or after_update hooks:
Code: Select all
sql('your update query goes here', $eo);