codeigniter

How to insert a text with special chars in mysql using codeigniter

删除回忆录丶 提交于 2019-12-25 03:54:24
问题 I am trying to insert a text in mysql database that contains special chars (example : 'é' ) the text is inserted and 'é' is replaced with '?' i am using codeigniter active record Can anyone explain to me how to do that? Thanks in advance! 回答1: You need to create the database using collation utf8_unicode_ci. Also for phpMyAdmin. After creating the database click on the operations tab at the bottom you can change the database to the utf8_unicode_ci. For more information Here 回答2: Following

How to insert a text with special chars in mysql using codeigniter

孤人 提交于 2019-12-25 03:54:07
问题 I am trying to insert a text in mysql database that contains special chars (example : 'é' ) the text is inserted and 'é' is replaced with '?' i am using codeigniter active record Can anyone explain to me how to do that? Thanks in advance! 回答1: You need to create the database using collation utf8_unicode_ci. Also for phpMyAdmin. After creating the database click on the operations tab at the bottom you can change the database to the utf8_unicode_ci. For more information Here 回答2: Following

Apache mod_rewrite Clean URLs

£可爱£侵袭症+ 提交于 2019-12-25 03:53:16
问题 I am using CodeIgniter on PHP and it produces the following URLs: http://my.domain.com/app/index.php?/admin/main/ the /index.php? is redundant so I remove it successfully with the following rewrite rule: RewriteCond $1 !^(index\.php|images|robots\.txt) RewriteRule ^(.*)$ ./index.php/$1 [L] however, I would also like to remove the /app part, but when I do so, I get a 500 error. Is this related to Code Igniter - or how do I rewrite this rule correctly (if possible)? I tried with the following:

Codeigniter userdata not available

一个人想着一个人 提交于 2019-12-25 03:53:10
问题 I'm using CodeIgniter for my project. I'm near end and I cannot change session "engine" now. I have captcha image for comment posting on url: example.com/captcha and code: this->load->library('session'); header("Content-type: image/jpeg"); /* * Image generation code... */ $this->session->set_userdata('captcha', strtolower($word)); imagejpeg($image); imagedestroy($image); Usually when I'm submitting a form I use <img src="example.com/captcha" /> to generate image and set userdata. But this

PHP CodeIgniter application not opening any page except default controller

假如想象 提交于 2019-12-25 03:32:47
问题 My website was hosted on domain seeingtheworld.org and my htaccess was as follows: php_value upload_max_filesize 1024M php_value post_max_size 1024M php_value max_execution_time 2700 php_value max_input_time 2700 Options +FollowSymlinks RewriteEngine On RewriteBase /seeingtheworld RewriteCond %{REQUEST_URI} ^system.* RewriteRule ^(.*)$ /index.php/$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] This is the link working fine.

CodeIgniter - $this->uri->segment() returns empty

微笑、不失礼 提交于 2019-12-25 03:32:11
问题 I am trying to get the CodeIgniter calender library to work, and for that I need to use $this->uri->segment() , according to the documentation at least. The url for the calender looks like this: http://www.example.com/index.php/tasks/calendar/2015/03 Which means, as far as I can understand, that $this->uri->segment(3 ) would be the year, and $this->uri->segment(4) the month. However, both of these returns nothing at all, here is the code for my calender page: echo "Selected year: ".$this->uri

showing undefined data in chart.js but showing array in inspect element

喜你入骨 提交于 2019-12-25 03:30:33
问题 I am trying to display total montly sales of a financial april to march of a year. I am using chart.js and codeigniter for this .. I have tried query in phpmyadmin , and giving me columns there, the same array is displaying in console log but when I run chartjs. It shows me undefined. Also I have written query for displaying last years data, but it is giving me one column of 2015, dont know how it is comming there. <<>> added edit- i tried google charts, morris charts, highcharts, charts.js,

Codeigniter getuser() returns 0 after facebook dialog

℡╲_俬逩灬. 提交于 2019-12-25 03:27:28
问题 You could say that this post is dublicate but I'm searching for nearly 2 days , couldn't figured out. After moved to new server and installed new ssl, I'm having difficulties for facebook login in two different scenarios. First Scenario: User haven't logged in to facebook and facebook login redirects user to , facebook login. After user login, facebook redirects to redirect_url and getuser returns 0. (User could login if return back to facebook login page on my website so getuser works when

CodeIgniter Composer “package.json” locations shluld be in application or root folder?

坚强是说给别人听的谎言 提交于 2019-12-25 03:22:55
问题 I working with code igniter v3.x and I would like to add some composer packages. looking at application/config/config.php file, it says that will load packages inside application folder | package auto-loader script in application/vendor/autoload.php. However in the codeigniter package it already has a package.json that installs packages on root folder. I suspect that the package.json on the root must hold only information about CodeIgniter it self. But I'm not sure. So I have three options:

Refreshing a page with codeigniter after ajax click event

北城以北 提交于 2019-12-25 03:19:22
问题 I have the following php codeigniter function code which is being called by a jquery ajax function: $this->load->library('session'); $this->load->helper('url'); $ids = $_POST['i']; $message = $_POST['m']; var_dump($message); var_dump($ids); $sql = 'update replies set `response` = "'.$message.'" where id IN ('.implode( ',', $ids).')'; echo $sql; R::exec($sql); // works normally to here redirect($this->uri->uri_string()); I want to refresh the page after the db insertion of 'message'. however