![]() |
Made changes to query in code. No change in the website. - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Made changes to query in code. No change in the website. (/showthread.php?tid=24567) Pages:
1
2
|
Made changes to query in code. No change in the website. - El Forum - 11-12-2009 [eluser]jt66250[/eluser] I changed this code: function retrieve_practice_areas($language = 'en') { $this->db->select('title_' . $language . ' as title, title_escaped_' . $language . ' as title_escaped' ); $this->db->where('section_id', 1); $this->db->orderby('title_' . $language, 'ASC'); $query = $this->db->get('content_pages'); $rows = $query->result(); return $rows; } to this code: (changes are bolded) function retrieve_practice_areas($language = 'en') { $this->db->select('title_' . $language . ' as title, title_escaped_' . $language . ' as title_escaped' ); $this->db->where('section_id', 1 . 'viewable', 0); $this->db->orderby('title_' . $language, 'ASC'); $query = $this->db->get('content_pages'); $rows = $query->result(); return $rows; } The query works in mysql but there is no change to my website? Any clues on why? Made changes to query in code. No change in the website. - El Forum - 11-12-2009 [eluser]puzzlebox[/eluser] I think this: $this->db->where(‘section_id’, 1 . ‘viewable’, 0); should be $this->db->where(‘section_id’, 1)->where(‘viewable’, 0); er that's what you wanted to do right? Made changes to query in code. No change in the website. - El Forum - 11-12-2009 [eluser]jt66250[/eluser] I made that change but it didnt fix the problem. The website still didnt change. This page is the content_model.php page under application/models/. Am I missing something here? I even removed that code totally just to see if it had any effect on the website and it had none. The website displayed the data as if the code was there. Does this page directly affect the website or is there another go between page I need to adjust. Made changes to query in code. No change in the website. - El Forum - 11-12-2009 [eluser]puzzlebox[/eluser] can you try returning $this->db->last_query()? then compare that to the query you said is working.. or post it here ![]() Made changes to query in code. No change in the website. - El Forum - 11-12-2009 [eluser]jt66250[/eluser] The query isnt the real issue. My issue is when I make changes to the content_model.php page, will it directly affect the website. I removed the entire function and nothing happened on the website. What page do I need to edit to directly affect the queries on the website. It doesnt help to correct a query if its not being corrected in the right location. Made changes to query in code. No change in the website. - El Forum - 11-12-2009 [eluser]puzzlebox[/eluser] can you please check who uses the function retrieve_practice_areas.. Made changes to query in code. No change in the website. - El Forum - 11-12-2009 [eluser]jt66250[/eluser] Yes its a subnavigation on one of my pages. I removed the entire function but the navigation was still there. I did that just to see if I could even edit the navigation with that function. Nothing changed. I am not sure I am even editing the right page. If I find the code that can edit that navigation, then I can make sure the right query is there. Made changes to query in code. No change in the website. - El Forum - 11-12-2009 [eluser]puzzlebox[/eluser] check the function that calls it please.. it's probably inside the model or controller folder Made changes to query in code. No change in the website. - El Forum - 11-12-2009 [eluser]jt66250[/eluser] in the controllers/content.php page here is the function that calls it function sitemap() { $this->load->view('content/sitemap', array( 'attorneys' => $this->content_model->retrieve_pages($this->language, 4), 'practice_areas' => $this->content_model->retrieve_pages($this->language, 1) )); } I'm not seeing anything there that is causing it not to update on the website once I change the query. Am I missing something? Made changes to query in code. No change in the website. - El Forum - 11-12-2009 [eluser]puzzlebox[/eluser] and how is $practice_areas used in applications/views/content/sitemap.php? |