Bonjour, merci d'avance pour votre aide car à je perds un temps fou sur ce problème !

J ai un soucis d'accent comme vous pouvez voir sur l'image pour project_category

http://www.guitaretv.com/partage/new.jpg


J ai réussi à corriger ce problème d accent pour project_summary et project_title (qui se trouvent tous les deux dans la base de donnée "Project" en ajoutant un utf8_encode

$row['project_title'] = utf8_encode($row['project_title']);


Mais là je ne sais pas du tout comment corriger le problème pour project_category_name_fr qui est situé dans la base de donnée project_category

http://www.guitaretv.com/partage/project_category3.jpg

Voici le model.php qui gérer cette page:

	function new_projects($offset=0)
	{	
		
		$this->load->library('pagination');
		$limit = 9;
		$config['base_url'] = site_url('project/new_projects/');
		$config['total_rows'] = $this->project_model->new_projects_total();
		$config['per_page'] = $limit;		
		$this->pagination->initialize($config);		
		$data['page_link'] = $this->pagination->create_links();
		
		$data['total_rows'] = $config['total_rows'];
		$data['per_page'] = $limit;
		$data['offset'] = $offset;
		
		$data['limit'] = $limit;
		$data['idea']=$this->home_model->get_idea();
		
		/* @TODO : migrer vers model */
		
		$link = mysql_connect("localhost", "test", "test_mathieu") or die('Connexion impossible : ' . mysql_error());
		$db = mysql_select_db("admin_bliister", $link) or die('Sélection database impossible : ' . mysql_error());
		$query = mysql_query("select * from project where status = 1 and active = 1 and active_cnt = 1 order by date_added limit 0,9") or die('Query impossible : ' . mysql_error());

		$tab = array();

		while ($row = mysql_fetch_assoc($query)) {
			
			$interval = date_diff(date_create(), date_create($row['date_added']));
			
			//var_dump($interval->format("%a"));
			
			if ($interval->format("%a") < 300 && $interval->format("%a") >= 0) {
			
				$row['project_summary'] = utf8_encode($row['project_summary']);
				$row['project_title'] = utf8_encode($row['project_title']);
				/* $row['project_category'] = utf8_encode($row['project_category']); */
				array_push($tab, (object) $row);
			
			}
		}

		mysql_free_result($query);
		$data['result'] = $tab;
		
		
		//$data['result'] = $this->project_model->new_projects($offset, $limit);
		
		$data['gallery']=$this->home_model->get_gallery();
		$data['site_setting'] = $this->home_model->select_site_setting();
		$data['category'] = $this->home_model->get_category();
		$data['dvd_category'] = $this->home_model->get_dvd_category();
		$data['alternative_category'] = $this->home_model->get_alternative_category();
		$data['advertise']=$this->home_model->get_advertise();
		
		$meta = $this->home_model->select_meta_setting();
		$data['searchprj'] = "";
		
		$data['header_menu']=$this->home_model->dynamic_menu(0);
		$data['footer_menu']=$this->home_model->dynamic_menu_footer(0);
		$data['right_menu']=$this->home_model->dynamic_menu_right(0);
		
		
		$this->home_model->select_text();
		
		$this->template->write('meta_title', 'New Campaign-'.$meta['title'], TRUE);
		$this->template->write('meta_description','New Campaign-'. $meta['meta_description'], TRUE);
		$this->template->write('meta_keyword', 'New Campaign-'.$meta['meta_keyword'], TRUE);
		$this->template->write_view('search', 'search', $data, TRUE);
		$this->template->write_view('header', 'header', $data, TRUE);
		$this->template->write_view('main_content', 'new_projects', $data, TRUE);
		
/* 		if($_SESSION['lang_code'] == 'fr') { 
			$this->template->write_view('sidebar', 'category_french', $data, TRUE);
		} else { 
			$this->template->write_view('sidebar', 'category', $data, TRUE);
		} */
		
		$this->template->write_view('footer', 'footer',$data, TRUE);
		$this->template->render();
	}
	
	function new_projects_ajax($n = '',$match='none')
	{
		$limit = 9;
		$data['offset'] = $n;
		$data['limit'] = $limit;
		$data['total_rows'] = $this->project_model->new_projects_total();
		$data['per_page'] = $limit;
		$data['site_setting'] = $this->home_model->select_site_setting();
		$data['result'] = $this->project_model->new_projects($n, $limit);
		$this->load->view('new_projects_ajax', $data);
	}
	
	
	

Modifié par cedrus (02 Feb 2013 - 19:41)