Hook setup
Hook setup
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
Would you post the hooks code you added please?
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.
Re: Hook setup
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).
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
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);
AppGini plugins to add more power to your apps:
- DataTalk is an innovative AppGini plugin based on ChatGPT that allows you to interact with your AppGini database using natural language questions, without writing any SQL. Check the demo video
- Mass Update plugin: Update multiple records at once and improve your workflow efficiency.
- Check our other plugins and get a generous discount of up to 30% when buying 2 or more plugins.