Skip to content
Advertisement

Tag: codeigniter

How to submit a post-method form to same get-url in different function in CodeIgniter?

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]’);

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

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

Advertisement