Can we run mysql queries in hooks?

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
bambinou
Veteran Member
Posts: 163
Joined: 2013-02-01 15:09

Can we run mysql queries in hooks?

Post by bambinou » 2013-06-27 10:48

Hello,

I would like to know if it is possible to run mysql queires through hooks please:
function tablename_before_insert(&$data, $memberInfo, &$args){



return TRUE;

}


If yes, do we have to create a mysql connection in each hook file or does your file connect automatically?



Thank you,

Ben

KSan
AppGini Super Hero
AppGini Super Hero
Posts: 252
Joined: 2013-01-08 20:17

Re: Can we run mysql queries in hooks?

Post by KSan » 2013-06-28 03:19

Yes. This is possible. You do not need to create a new connection each time. See a discussion I had which ended with sql queries as a solution. Some good sql examples there :

http://forums.appgini.com/phpbb/viewtopic.php?t=637

Post Reply