Welcome Guest, Not a member yet? Register   Sign In
Made changes to query in code. No change in the website.
#1

[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?
#2

[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?
#3

[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.
#4

[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 Smile
#5

[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.
#6

[eluser]puzzlebox[/eluser]
can you please check who uses the function retrieve_practice_areas..
#7

[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.
#8

[eluser]puzzlebox[/eluser]
check the function that calls it please.. it's probably inside the model or controller folder
#9

[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?
#10

[eluser]puzzlebox[/eluser]
and how is $practice_areas used in applications/views/content/sitemap.php?




Theme © iAndrew 2016 - Forum software by © MyBB