codeigniter-3

Message: Uninitialized string offset: 0 while inserting dynamic input field data

╄→гoц情女王★ 提交于 2019-12-02 06:33:06
I am using CodeIgniter, I am getting dynamically select boxes. From the second select box, the user can select the status and according to the status input field will display. Check this below screenshot, If the user clicked on Add More then below select box will display. Now from the second select box, I choose Status one so according to the selected value, remark input field displayed. Check below screenshot. If the user wants more fields for ID 2 then the user will click on add Bank . For example, I clicked two times and I chose a status. so It will display like this. because Each row has

function to simulate left join on array not working properly in PHP

夙愿已清 提交于 2019-12-02 04:26:41
I have two arrays like this : $left = [ ['UserID' => 6835406], ['UserID' => 8418097], ]; $right = [ ['Amount' => 0.00, 'UserID' => 6835406], ['Amount' => 0.00, 'UserID' => 8418097] ]; I'm using this function to perform a left join on the arrays based on the UserID feild : function left_join_array($left, $right, $left_join_on, $right_join_on = NULL){ $final= array(); if(empty($right_join_on)) $right_join_on = $left_join_on; foreach($left AS $k => $v){ $final[$k] = $v; foreach($right AS $kk => $vv){ if($v[$left_join_on] == $vv[$right_join_on]){ foreach($vv AS $key => $val) $final[$k][$key] =

Codeigniter 3.x Login with Form Validation -Boiler plate

泄露秘密 提交于 2019-12-02 04:20:58
I have been reading couple of questions here from different newbies about Login and validation in codeigniter, some have mixed JavaScript and J-query. Codeigniter itself provide a robust form validation along with custom error setting support. I have decided to share with you the easiest way to kickstart in codeigniter with login boilerplate which I have created and I am sharing it with you. It has Controller Login Model : Login_model Views : Login and success And basic configurations Step-1 Download Codeigniter 3.x from Official Website Step-2 Extract in a folder in your localhost root.

Codeigniter array backend validation

跟風遠走 提交于 2019-12-02 04:02:00
I'm using a form, inside which contains a div with a pair of input field which is added dynamically. VIEW: <?php echo form_open_multipart('location/add'); ?> <div> <input type="text" name="title[]"/> <div id="infoMessage"><?php echo form_error('title[]'); ?></div> </div> <div> <input type="text" name="desc[]"/> <div id="infoMessage"><?php echo form_error('desc[]'); ?></div> </div> <div> <input type="text" name="link[]"/> <div id="infoMessage"><?php echo form_error('link[]'); ?></div> </div> <input type="submit" name="" value="enter"> <?php echo form_close(); ?> Now, Initially I don't want

Clear form data after success codeigniter using php not jquery

天涯浪子 提交于 2019-12-02 03:06:43
问题 I have a registration form. after success i want to remove set_value value and unset all posted value. view.php <?php echo validation_errors(); ?> <?php if(isset($msg)){ echo $msg; } ?> <form action="" method="post"> <h5>Username</h5> <input type="text" name="username" value="<?php echo set_value('username'); ?>" size="50" /> <h5>Password</h5> <input type="text" name="password" value="<?php echo set_value('password'); ?>" size="50" /> <div> <input type="submit" value="Submit" /> </div> </form

codeigniter adding the IS NULL in the find_in_set

大城市里の小女人 提交于 2019-12-02 02:41:46
问题 while generating the query through codeigniter framework $this->db->select('id,memo,sent_to,sent_by,read_by,date')->from('memos') ->where("FIND_IN_SET('1',`sent_to`)")->order_by('`id`','DESC')->get(); i got an error of adding IS NULL in the query automatically it produce SELECT `id`, `memo`, `sent_to`, `sent_by`, `read_by`, `date` FROM `memos` WHERE FIND_IN_SET('1',`sent_to`) IS NULL ORDER BY `id` DESC instead of SELECT `id`, `memo`, `sent_to`, `sent_by`, `read_by`, `date` FROM `memos` WHERE

codeigniter adding the IS NULL in the find_in_set

随声附和 提交于 2019-12-02 00:02:10
while generating the query through codeigniter framework $this->db->select('id,memo,sent_to,sent_by,read_by,date')->from('memos') ->where("FIND_IN_SET('1',`sent_to`)")->order_by('`id`','DESC')->get(); i got an error of adding IS NULL in the query automatically it produce SELECT `id`, `memo`, `sent_to`, `sent_by`, `read_by`, `date` FROM `memos` WHERE FIND_IN_SET('1',`sent_to`) IS NULL ORDER BY `id` DESC instead of SELECT `id`, `memo`, `sent_to`, `sent_by`, `read_by`, `date` FROM `memos` WHERE FIND_IN_SET('1',`sent_to`) ORDER BY `id` DESC You need to add !=0 is your where clause to remove IS

Severity: 8192 Message: Methods with the same name as their class will not be constructors in a future version of PHP;

。_饼干妹妹 提交于 2019-12-01 20:51:23
问题 Severity: 8192 Message: Methods with the same name as their class will not be constructors in a future version of PHP; CI_Pagination has a deprecated constructor Filename: libraries/Pagination.php Line Number: 27 class CI_Pagination { var $base_url = ''; // The page we are linking to var $total_rows = ''; // Total number of items (database results) var $per_page = 10; // Max number of items you want shown per page var $num_links = 2; // Number of "digit" links to show before/after the

Severity: 8192 Message: Methods with the same name as their class will not be constructors in a future version of PHP;

老子叫甜甜 提交于 2019-12-01 18:40:36
Severity: 8192 Message: Methods with the same name as their class will not be constructors in a future version of PHP; CI_Pagination has a deprecated constructor Filename: libraries/Pagination.php Line Number: 27 class CI_Pagination { var $base_url = ''; // The page we are linking to var $total_rows = ''; // Total number of items (database results) var $per_page = 10; // Max number of items you want shown per page var $num_links = 2; // Number of "digit" links to show before/after the currently viewed page var $cur_page = 0; // The current page being viewed var $first_link = '‹ First'; var

Codeigniter: get all values from single column as array

流过昼夜 提交于 2019-12-01 14:48:07
问题 Here is my query to get a single column from t $sql = "SELECT `id` FROM `loc8_groups`"; $query = $this->db->query($sql); print_r($query>result()); Its produce array result like this way. Array ( [0] => stdClass Object ( [id] => 1 ) [1] => stdClass Object ( [id] => 2 ) [2] => stdClass Object ( [id] => 3 ) ) But i want result as single associative array that contains all the ids . 回答1: Try this code: $sql = "SELECT `id` FROM `loc8_groups`"; $query = $this->db->query($sql); $array1=$query>result