codeigniter-2

How to remove the single cart item using codeigniter cart class?

萝らか妹 提交于 2019-12-04 13:55:43
I am using codeigniter cart class for my shopping cart project. I have number of items on the cart. Now I do have cart row id. Now what exactly i need to do is, need to remove the particular item from the cart not all the contents(Destroying cart). $cartcontents = $this->cart->product_options($rowid); and unseting all contents. but doesn't works out. Please do help you anybody have an idea. Thank You. $data = array( 'rowid' => '30ef30b64204a3088a26bc2e6ecf7602', 'qty' => 0 ); $this->cart->update($data); use this Use "removeCartItem" function in your controller to do this... function

CodeIgniter DB Session problems: sess_expire_on_close

依然范特西╮ 提交于 2019-12-04 13:39:17
I've encountered a very odd problem with CI's session when stored in the DB. I'm using sessions to store information about whether or not a user is logged in on my site. For some reason, a friend of mine from Lithuania (I mention the country in case it's relevant somehow) could not log in. When I monitored the session table, it seemed like she was creating a new session for each page she went to. She tried using various browsers, but the same problem occurred regardless of browser. No one else has this problem (all other testers are outside of Lithuania). Here's the odd thing: I was able to

Code Igniter 2.1 autocomplete/IntelliSense in Eclipse

对着背影说爱祢 提交于 2019-12-04 12:02:22
问题 I am using Eclipse PDT to code with PHP Code Igniter. I would like to get auto complete working. Anyone know how I can accomplish this? I've found a few online tutorials but had no success. 回答1: You could try this method Choose “Project” -> “Properties” or “Window” -> “Preferences” -> “PHP” (for global usage) Choose “PHP Include Path” Click on “Add External Source Folder” and point to file below restart eclipse Point path to this file below ciautocomplete.php <?php /** * @property CI_DB

PHPExcel - Create spreadsheet from HTML table?

依然范特西╮ 提交于 2019-12-04 10:47:20
I'm trying to create a simple reporting system, which can output either HTML or export to Excel. I have got it to create a HTML table successfully through a Codeigniter view but I want to know if there's any way I can re-use that view to create the Excel export, rather than doing it manually, as I'll then have to update it in two places every time I want to make a change to the report. Any advice appreciated. Thanks. This seems to be working: // Load the table view into a variable $html = $this->load->view('table_view', $data, true); // Put the html into a temporary file $tmpfile = time().'

Codeigniter Active Record - Count Total Found Rows with Limit (MySQL)

淺唱寂寞╮ 提交于 2019-12-04 09:43:50
问题 I'm using a complex SQL query in a Codeigniter model with a limit applied. I'd like to count the total number of rows that would have been found if the limit and offset had not been applied. I'd like to return the count, along with the result array, to my controller - how do I do this? Where do I put SQL_CALC_FOUND_ROWS if this is the right solution? Here's the query (which I didn't build myself originally): $this->db ->select('table1.* ,table2.* ,table3.* ,table4.* ,table5.* ,table6.*

how to pass a variable from one controller to the other in Code igniter

谁说胖子不能爱 提交于 2019-12-04 09:36:57
问题 I have just started learning Code Igniter . I want to know how can I pass a variable from one controller(first_cont.php) to other controller (second_cont.php) ? Any help would be appreciated . Thanks in Advance :) 回答1: It will depend on the circumstances. If you want to retain the data for some time, then session data would be the way to go. However, if you only need to use it once, flash data might be more appropriate. First step would be to initialise the session library: $this->load-

Extending Multiple models in Codeigniter 2

╄→尐↘猪︶ㄣ 提交于 2019-12-04 06:58:34
How do you set up CI2 to allow extending of multiple models? I can only get it to extend one model (put in /application/core) named MY_Model (case sensitive). To choose what model to extend I am doing; in the model.. require_once APPPATH.'core/MY_Another_model.php'; class Test_model extends MY_Another_model { ... } I can't find where in the core system code where it states only to allow models that are being extended to be called MY_Model. Thank you for any and all help. Cubed Eye As I said in this question about the controllers you just put both classes in the same MY_Model file. This file is

What Does Doctrine Add Above Active Record - CodeIgniter?

我是研究僧i 提交于 2019-12-04 06:27:28
I really like CodeIgniter's Active Record and how nicely it allows all my needed database queries. But I've also been reading about ORMs like Doctrine. When I read Doctrine's documentation, it does not seem as clear to use as Active Record, and I can't see what makes it better (if it is). What does Doctrine allow that is not possible with Active Record? Does Doctrine make the same job faster, easier, better? Or does it do things Active Record cannot do? Best would be if people could post examples of tasks showing what we're talking about. Thanks, Matthew birderic Doctrine is a full-fledged ORM

How to store multi byte characters in SQL Server database using CodeIgniter

穿精又带淫゛_ 提交于 2019-12-04 06:15:11
I'm using MS SQL Server and CodeIgniter 2 with Active Record for a project I'm working on, and I just stumbled upon this issue: When I submit a form that contains Chinese or Hindi characters, I store it in a table, and when I view it all I get are question marks. If I try English or Greek characters, everything seems to work fine. The reason I believe this is something to do with the PHP I'm writing, is because if I copy-paste the chinese text directly in SQL Server Management Studio, all values are stored and displayed perfectly, both on the SQL Studio, and the web application. These are the

Active record - 3 results found, but only one being returned

跟風遠走 提交于 2019-12-04 05:51:31
问题 The query below is returning that 3 results are available, but it is only returning one entry id. How can I have the three entry_id's returned? $this->EE->db->select('entry_id, count(portfolio_number) AS results'); $this->EE->db->from('submissions'); $this->EE->db->where('type_id', '1'); $this->EE->db->where('member_group', $member_group); $this->EE->db->group_by('portfolio_number'); $this->EE->db->having('results = 3'); $query = $this->EE->db->get(); $submissions = $query->result_array();