Re: Single query at bootstrap: how to
After some tests it seems like the connection is reset after this first query (I had to use $this-query in place of $this-execute), so all the dates are visualized as in the old timezone. I already tried with a simple set timezone etc; SELECT date; from console/phpmyadmin and it works so it surely is a problem with cakephp that reset the connection, thus resetting the new timezone setting too.. Any advice?? thanks On Jul 4, 6:00 pm, majna majna...@gmail.com wrote: Using AppModel constructor works for me: function __construct($id = null, $table = null, $ds = null) { parent::__construct($id, $table, $ds); if (!defined('GLOBAL_ZONE_SET') $this-useTable !== false) { $this-execute(SET GLOBAL time_zone = ‘+2:00′'); define('GLOBAL_ZONE_SET', true); } } On Jul 4, 4:31 pm, ark0n3 nicolabeg...@gmail.com wrote: Hi everyone I'm going crazy for such a trivial matter. I need to run a one-time queryat the beginning of the connection to the mysql server (SET GLOBAL time_zone = ‘+2:00′) but can't figure out where I need to put the code in the cake codebase. Many thanks in advance to whoever will help me fix this. ps i already tried in the contructor of app_model.php but got not luck with cake 1.2.10 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Single query at bootstrap: how to
THANK you so much! I tried that approach before but got some weird errors so dismissed it without trying any further.. this way it works perfectly! thanks again On Jul 4, 6:00 pm, majna majna...@gmail.com wrote: Using AppModel constructor works for me: function __construct($id = null, $table = null, $ds = null) { parent::__construct($id, $table, $ds); if (!defined('GLOBAL_ZONE_SET') $this-useTable !== false) { $this-execute(SET GLOBAL time_zone = ‘+2:00′'); define('GLOBAL_ZONE_SET', true); } } On Jul 4, 4:31 pm, ark0n3 nicolabeg...@gmail.com wrote: Hi everyone I'm going crazy for such a trivial matter. I need to run a one-time query at the beginning of the connection to the mysql server (SET GLOBAL time_zone = ‘+2:00′) but can't figure out where I need to put the code in the cake codebase. Many thanks in advance to whoever will help me fix this. ps i already tried in the contructor of app_model.php but got not luck with cake 1.2.10 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Single query at bootstrap: how to
Hi everyone I'm going crazy for such a trivial matter. I need to run a one-time query at the beginning of the connection to the mysql server (SET GLOBAL time_zone = ‘+2:00′) but can't figure out where I need to put the code in the cake codebase. Many thanks in advance to whoever will help me fix this. ps i already tried in the contructor of app_model.php but got not luck with cake 1.2.10 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
Re: Single query at bootstrap: how to
Using AppModel constructor works for me: function __construct($id = null, $table = null, $ds = null) { parent::__construct($id, $table, $ds); if (!defined('GLOBAL_ZONE_SET') $this-useTable !== false) { $this-execute(SET GLOBAL time_zone = ‘+2:00′'); define('GLOBAL_ZONE_SET', true); } } On Jul 4, 4:31 pm, ark0n3 nicolabeg...@gmail.com wrote: Hi everyone I'm going crazy for such a trivial matter. I need to run a one-time query at the beginning of the connection to the mysql server (SET GLOBAL time_zone = ‘+2:00′) but can't figure out where I need to put the code in the cake codebase. Many thanks in advance to whoever will help me fix this. ps i already tried in the contructor of app_model.php but got not luck with cake 1.2.10 -- Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions. To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php