Page 1 of 1

Can we run mysql queries in hooks?

Posted: 2013-06-27 10:48
by bambinou
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

Re: Can we run mysql queries in hooks?

Posted: 2013-06-28 03:19
by KSan
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