codeigniter

Saving articles and related categories according to normalization

有些话、适合烂在心里 提交于 2019-12-24 13:46:52
问题 Saving articles_categories according to normalization I have three tables ----------- articles ----------- id int(11) title varchar(100) ----------- categories ---------- id int(11) title varchar(100) ------------------- articles_categories -------------------- articles_id int(11) categories_id int(11) I want to save it according to normalization rule to achieve like this articles_id | categories_id 1 1 1 2 1 3 How can I achieve with code igniter thanks. So far I had already tried like this

Codeigniter: Uploaded images permission is 600 in web server, images not displaying in website

∥☆過路亽.° 提交于 2019-12-24 13:25:40
问题 I uploaded my image using codeigniter, uploaded images not displaying in my website, then i went filezilla and searched about that file, the folder permission is 755 but file permission is 600, if i change the file permission to 644, then image displays fine, but i cann't do like this for all uploading images. so, is there any way to fix it? $config['upload_path'] = './assets/images/'; $config['allowed_types'] = 'gif|jpg|png'; $config['max_size'] = '100'; $config['max_width'] = '600'; $config

Filter and pagination on CodeIgniter

99封情书 提交于 2019-12-24 13:22:47
问题 I'm new at CodeIgniter, but I want to ask about pagination and filtering. I did them and they works great aside from each other, but I have two pages with filters and pagination too. They gives me some errors. -When I click Filter, the url is like this: company/components/all/names_of_filters so the filters works at uri segment(4). =========================================================================But when I load pagination it shows me company/components/all/pagination so the filters

Codeigniter sub-folder multiple controllers

末鹿安然 提交于 2019-12-24 13:13:40
问题 Here is my htaccess file and it works somewhat. Not matter what controller I specify it always goes to the home page <IfModule mod_rewrite.c> RewriteEngine On #Checks to see if the user is attempting to access a valid file, #such as an image or css document, if this isn't true it sends the #request to index.php RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d #This last condition enables access to the images and css folders, and the robots.txt file RewriteCond $1 !^

Codeigniter subquery exists

ⅰ亾dé卋堺 提交于 2019-12-24 13:02:34
问题 Im trying to do a subquery with $this->db->where(" EXISTS (SELECT * FROM myTable)"); But it doesnt work, the output of this is: myquery + WHERE 'EXISTS (SELECT * FROM myTable); That quote before the EXISTS makes the query unresolvable! Does anyone knows how to solve it? Thanks! 回答1: please remove space before and after EXISTS keyword.that does not display any error. $this->db->where("EXISTS(SELECT * FROM myTable)"); 回答2: Maybe you could try to set the escape to false by using $this->db->where

Codeigniter subquery exists

你说的曾经没有我的故事 提交于 2019-12-24 12:55:25
问题 Im trying to do a subquery with $this->db->where(" EXISTS (SELECT * FROM myTable)"); But it doesnt work, the output of this is: myquery + WHERE 'EXISTS (SELECT * FROM myTable); That quote before the EXISTS makes the query unresolvable! Does anyone knows how to solve it? Thanks! 回答1: please remove space before and after EXISTS keyword.that does not display any error. $this->db->where("EXISTS(SELECT * FROM myTable)"); 回答2: Maybe you could try to set the escape to false by using $this->db->where

where condition from a comma seperated varchar in mysql and codeigniter

谁说我不能喝 提交于 2019-12-24 12:48:40
问题 i have two tables called musical_types and musical_albums in which musical_types consists of type_name and an auto increment id, where as in the musical_albums table contains auto increment id , name , types which is a varchar which stores the id of musical_types as comma seperated values like 1,2,3,4 etc. So could anyone please help me in getting all the albums of type x from musical_albums table. I tried mysql like but it is not correct. so please help me in writing this query.. iam using

How to update a column value with the current column value plus an increment in codeigniter?

偶尔善良 提交于 2019-12-24 12:36:56
问题 I want to to update a column value with the current column value plus an increment. My table structure is as follows: id | menu | priority __________________________ 1 | One | 2 2 | Two | 3 3 | Three | 1 A simple query I have tried that is working: update table set priority=priority+1 where id=2 in codeigniter: $update_new_pri=$this->db->where('id',$menu_ids[$i])->update($this->table['menu'],array('menu_priority'=>'menu_priority+1')); But it's not working. 回答1: According to docs You may also

Codeigniter Mail function sends mail to spam folder [duplicate]

╄→гoц情女王★ 提交于 2019-12-24 12:36:25
问题 This question already has answers here : How do you make sure email you send programmatically is not automatically marked as spam? (22 answers) Closed 3 years ago . I am using codeigniter mail function. Its sends mail perfectly. But all the time mail going to the spam folder. How can I overcome this. Function function msg_now(){ $this->load->library('email'); $this->load->library('parser'); $config['protocol'] = 'sendmail'; $config['wordwrap'] = TRUE; $config['mailtype'] = 'html'; $this-

Summernote image upload error

浪子不回头ぞ 提交于 2019-12-24 12:30:52
问题 I'm using codeigniter, twitter bootstrap and summernote as my WYSIWYG editor. Im facing some problem with the image upload. Whenever uploading an image using Summernote, it serializes the image in a base64 string. That base64 string is so long that it doesnt fit in the text data-type in phpmyadmin. What i want to do is, upload the image using PHP upload function and store its url in the database instead of the base64 string. How would i do that? With reference to this post, here's the code, $