I found CodeIgniter form validation to show error message with load->view method, and will lost field error message if use “redirect”. Currently I use one function to show form page, and another function to deal form post. class Users extends CI_Controller { function __construct() { parent::__construct(); } public function sign_up() { $this->load->view(‘users/sign_up’); } public function do_sign_up(){ $this->form_validation->set_rules(‘user_login’, ‘User Name’, ‘trim|required|is_unique[users.login]’);
Tag: codeigniter
php isset shorthand else return array not working
I have this php code line Is something wrong with the isset shorthand because when I print_r($data[‘viewData’][‘filter’] with else being active, returns nothing/null/empty. What could be wrong? Edit, to add more info: Code inside the controller: Code inside view: And I get nothing when the else enters Codeigniter is used as framework *prePrint is just a custom function that contains
select max codeigniter
Im trying to get an max value with codeigniter from an table but it isnt working. This is the error i get: Severity: 4096 Message: Object of class CI_DB_mysql_result could not be converted to string Filename: database/DB_active_rec.php Line Number: 427 This is my function: What im trying to do is as followed: Select the highest id where bedrijf_id = $bedrijf_id
access codeigniter session values from external files
In my codeigniter project i have added KCK finder. it needs some of session values which is controlled by codeigniter. how can i access CI session values from external files ?
CodeIgniter – how to catch DB errors?
Is there a way to make CI throw an exception when it encounters a DB error instead of displaying a message like: A Database Error Occurred Error Number: 1054 Unknown column ‘foo’ in ‘…
Communicate between pop up window and the parent window
I’m working on a PHP/MySQL project using Codeigniter framework. The user fill a form with many data, and give me also FTP access to his web hosting, I want to POST FTP details to a popup after clicking Browse button, user will select a path (I’m using Codeigniter FTP Class), then I’ll grab the path after the user click Save,
how to get only not null element count in array php
i want to get only not null values count in that array , if i use count() or sizeof it will get the null indexes also . in my case i have an array like this Array ( [0] => ) the count is 1 . but i want to get the not null count , inthis case it should
CodeIgniter: Preventing row_array() vs row() typo’s?
Twice now I’ve mistakenly used row() instead of row_array() when fetching a single row result. Usually, it goes unchecked without any warning messages. 15-30 minutes later I finally notice the issue; …
Search with full name instead of just first name or last name
I am developing an API built with PHP and Codeigniter and I use MySQL as database. I have a user table called Users which contains the following columns: How can a user search this table using a full name? For example it works fine to search either by Martin or Smith, but not Martin Smith. This is the query I
Oracle to_date function with codeigniter
I am using Codeigniter to insert data into an Oracle table which contains a date field. Sample code looks like this: Now the problem is, to insert date fields into Oracle, i need to use the to_date function which is executed in the database. With the above code, the to_date function comes out inside single quotes and Oracle throws out