SQL query executed 3 times (not wanted) |
[eluser]Jelenik[/eluser]
Hi guys, i am experiencing a strange behaviour. I want to insert one row to database everytime is shown detail of video. But sql query seems to be executed 3 times - in profiler there is only 1 sql. I tried everything - i tried to remove all code which i dont use - only problematic part remains. I simplified functions - for example that function $this->Hlavny->zvys_pocet_zobrazeni do more (it actually updates detail of video too, but thats not important - it creates duplicity sql queries with simplified version too). It seems that there are some redirects or something, because i am experiencing this only when my url ends with slash. Lets get to the point. My routes.php Code: $route['default_controller'] = "something"; - i tried to use new feature and force to use only that one controller through settings in main controller index.php - but it didnt work either - and i found that there is a error with example -> There is: The controller class file name. Example: Mycontroller.php -> but it didnt work with .php at the end for me - i dont know if it depends on server on which codeigniter runs or its only bug. I have this controller: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); $this->project->inicializacia() - this is simple inicialization function, which is used only for setting up meta tags + profiler as you can see Code: function inicializacia() I am using model Hlavny.php: Code: <?php I found that there are 2 similiar thread on this forum with this kind of issue (both arent resolved as you can see): http://ellislab.com/forums/viewthread/68585/ http://ellislab.com/forums/viewthread/64160/ Knows somebody where can be that problem? I have lost 2 hours trying everything in code and on the end i noticed that without slash on the end it works - but this is not solution. |
Messages In This Thread |
SQL query executed 3 times (not wanted) - by El Forum - 03-06-2011, 11:32 PM
SQL query executed 3 times (not wanted) - by El Forum - 03-07-2011, 07:17 AM
SQL query executed 3 times (not wanted) - by El Forum - 03-07-2011, 09:07 AM
SQL query executed 3 times (not wanted) - by El Forum - 03-07-2011, 01:02 PM
SQL query executed 3 times (not wanted) - by El Forum - 03-07-2011, 01:25 PM
SQL query executed 3 times (not wanted) - by El Forum - 03-07-2011, 01:33 PM
|