codeigniter

Codeigniter- How to preserve form values if error on submit

情到浓时终转凉″ 提交于 2021-01-28 18:38:25
问题 I have the form field like <input type="text" class="form-control" name="postal_code" id="form_control_1" value="<?php if($user->postal_code === NULL) { echo set_value('postal_code');} else { echo $user->postal_code;} ?>"> <label for="form_control_1">Postal Code</label> <span class="help-block">Postal Code is required</span> and my function is public function postProfile() { if ($_POST) { $this->form_validation->set_rules('postal_code', 'Postal Code', 'required'); $this->form_validation->set

Rewrite URL Codeigniter

无人久伴 提交于 2021-01-28 18:00:36
问题 i'm using Codeigniter for my web app, i changed the structure of the project as the following : my_Project --- application --- public_html --- resources --- system I created the folder public_html to seperate my public files from the classes .. etc, but now i have to call this url every time : my_project/public_html/controller/action i want it to be this way : my_project/controller/action I already moved out the index.php from the URL using the rewrite mode, but i can't seem to remove the

batch “replace into” for CodeIgniter Active Record

丶灬走出姿态 提交于 2021-01-28 14:57:22
问题 CodeIgniter offers a great function to update in batch called update_batch() http://www.codeigniter.com/user_guide/database/query_builder.html?highlight=update_batch#CI_DB_query_builder::update_batch It also offers a function replace() to execute replace into mysql queries http://www.codeigniter.com/user_guide/database/query_builder.html?highlight=replace#CI_DB_query_builder::replace Is there any way to have something like replace_batch() or equivalent? I am using a loop with a replace inside

batch “replace into” for CodeIgniter Active Record

喜欢而已 提交于 2021-01-28 14:56:45
问题 CodeIgniter offers a great function to update in batch called update_batch() http://www.codeigniter.com/user_guide/database/query_builder.html?highlight=update_batch#CI_DB_query_builder::update_batch It also offers a function replace() to execute replace into mysql queries http://www.codeigniter.com/user_guide/database/query_builder.html?highlight=replace#CI_DB_query_builder::replace Is there any way to have something like replace_batch() or equivalent? I am using a loop with a replace inside

Can't update database after PayPal transaction in CodeIgniter 4

喜你入骨 提交于 2021-01-28 12:25:41
问题 I integrating PayPal in Codeigniter 4 but I can't get data after the transaction for an updated database What I want to do is to get a PayPal response from the IPN listener so that I can modify my database accordingly, but no matter what I do, it just won't work. I have already done the following in my PayPal Sandbox account: Enabled Auto Return Set Auto Return URL ('dashboard') Enabled Payment Data Transfer (PDT) Enabled IPN message reception Set IPN URL ('http:myDomain/Controller/index')

Can't update database after PayPal transaction in CodeIgniter 4

感情迁移 提交于 2021-01-28 12:18:49
问题 I integrating PayPal in Codeigniter 4 but I can't get data after the transaction for an updated database What I want to do is to get a PayPal response from the IPN listener so that I can modify my database accordingly, but no matter what I do, it just won't work. I have already done the following in my PayPal Sandbox account: Enabled Auto Return Set Auto Return URL ('dashboard') Enabled Payment Data Transfer (PDT) Enabled IPN message reception Set IPN URL ('http:myDomain/Controller/index')

Codeigniter Ajax gets 404 Error

不打扰是莪最后的温柔 提交于 2021-01-28 09:12:59
问题 I wrote an application on my local machine that works perfectly. I am using XAMPP so it is running Apache. When I uploaded the application to my ubuntu test server, I am getting a 404 error on the ajax call and I am honestly perplexed. I am using CodeIgniter 3.1.8. The controller is definitely there and the .htaccess is working fine on my local machine. I checked the case of the filename for the controller and it is fine. Here's the javascript of the ajax call: function step2(){ var canShow =

CodeIgniter - How to SELECT all rows in a big table without memory leake

对着背影说爱祢 提交于 2021-01-28 06:15:55
问题 It's kinda hard to undertsand my need in the title. CodeIgniter is performing a SELECT query in a table of 800,000+ rows in one shot. It takes a lot of memory, but in one specific server, I get a "Out of memory" fatal error. For performance purposes, I would like to seperate the select into 2 selects, and more specifically, the 50% first rows, and then the 50% left. I reuse this set of data to perform an INSERT afterwise. How to do that without losing/forgetting any single row ? 回答1: Beside

Cannot remove index.php from urls using Codeigniter on MAC OSX

微笑、不失礼 提交于 2021-01-28 05:47:50
问题 I just bought a Mac-pro with Mavericks 10.9.1 and before that I was working on pc with Windows 7. I created a project under the windows 7 OS and now I want to import it to OSX, the import was successful apart from the .htaccess file. I can't remove index.php from my urls. I have MAMP installed and my urls only work if I use index.php : don't work : (localhost/~username/feel/products) work : (localhost/~username/feel/index.php/products) I tried all the options of RewriteEngine, RewriteCond and

Error: Call to undefined method CodeIgniter\Database\MySQLi\Result::paginate()

左心房为你撑大大i 提交于 2021-01-28 05:26:10
问题 Struggling to wrap my head around paginate in CI4. All examples in the user guide shows the ->paginate() method linked directly onto the $model variable (without arguments) in the Controller. I have all my queries in the Model, so I'm a bit confused if the paginate method goes onto the end of my query there, or where it's called in the Controller. I've tried both - neither work. Model: public function brand_name($brand_name_slug) { return $this ->db ->table('shop a') ->select() ->join('