codeigniter

Codeigniter Delete … Where … and

南笙酒味 提交于 2021-02-17 03:22:19
问题 I need a little help. How can i send this query with codeigniter? Delete FROM friendconnect WHERE who = 5 and whos = 1 OR whos = 5 and who = 1; I found only that: $this->db->where('id', $id); $this->db->delete('mytable'); Thanks everybody! 回答1: $this->db->where('who', 5); $this->db->where('whos', 1); $this->db->or_where('whos', 5); $this->db->where('who', 1); $this->db->delete('friendconnect'); This is also an alternative: $this->db->where('who', 5)->where('whos', 1)->or_where('whos', 5)-

Codeigniter using form validation function “matches” with sub-array POST

喜夏-厌秋 提交于 2021-02-17 03:19:30
问题 Just started with CI last week and got this issue. What to put inside the matches function if I'm passing the form data as an array? I use array in the html form to locate all input fields inside single array in case I want to pass user generated input such as multiple phone numbers or emails. So everything is placed in array such as this: <div> <label for="password">Password</label> <input type="password" name="input[password]" id="password" value="<?php echo set_value("input[password]")?>"/

How to send the my sql result to controller in codeigniter as a variable

為{幸葍}努か 提交于 2021-02-16 14:58:27
问题 In my mode I am selecting a field as $query1 = $this->db->query("SELECT dPassword FROM tbl_login WHERE dEmailID='a@a.in'"); How to return dpassword as a variable to my controller I tried this way return dpassword; 回答1: The following is also fine: if($query1->num_rows() > 0){ $row = $query1->row(); } return $row->dPassword; Then if your query was to return more than a single row you could operate on the results like so: foreach($query1->result() as $row){ echo $row->field1; echo $row->field2;

How to send the my sql result to controller in codeigniter as a variable

﹥>﹥吖頭↗ 提交于 2021-02-16 14:56:45
问题 In my mode I am selecting a field as $query1 = $this->db->query("SELECT dPassword FROM tbl_login WHERE dEmailID='a@a.in'"); How to return dpassword as a variable to my controller I tried this way return dpassword; 回答1: The following is also fine: if($query1->num_rows() > 0){ $row = $query1->row(); } return $row->dPassword; Then if your query was to return more than a single row you could operate on the results like so: foreach($query1->result() as $row){ echo $row->field1; echo $row->field2;

How to install/enable GD in xampp windows [php 7.2]?

假装没事ソ 提交于 2021-02-16 13:55:51
问题 I Can't figure out how to install php-gd for PHP7.2. Is there any way to install/enable GD extension in xampp windows? I checked the php.ini file for php_gd2.dll but I can't find that line. It seems like GD is missing in PHP7.2. Any suggestions?? 回答1: Under xampp/php/php.ini look for "extension=gd2" and uncomment it, I presume this what you looking for 回答2: go to php.ini file search this ;xtension=gd remove ; then 来源: https://stackoverflow.com/questions/55474258/how-to-install-enable-gd-in

Codeigniter/PHP: Format db query as an array

淺唱寂寞╮ 提交于 2021-02-15 10:37:39
问题 $this->db->select('id, user_id')->from('be_users')->where('id',$user_id); $data['user_individual'] = $this->db->get(); If this is my db query, how do I get an array of one db row... ie. I want to do something like $data['user_individual']['id']->format_as_array ... 回答1: CodeIgniter provides several methods to perform on query results. See here: https://codeigniter.com/user_guide/database/results.html result() returns an array of PHP objects. row() returns a single PHP object for that row.

Codeigniter/PHP: Format db query as an array

前提是你 提交于 2021-02-15 10:37:28
问题 $this->db->select('id, user_id')->from('be_users')->where('id',$user_id); $data['user_individual'] = $this->db->get(); If this is my db query, how do I get an array of one db row... ie. I want to do something like $data['user_individual']['id']->format_as_array ... 回答1: CodeIgniter provides several methods to perform on query results. See here: https://codeigniter.com/user_guide/database/results.html result() returns an array of PHP objects. row() returns a single PHP object for that row.

CodeIgniter: 404 error on getting JS file

ぐ巨炮叔叔 提交于 2021-02-11 16:58:46
问题 I am installing a project that is based on CodeIgniter. In the login page when I try to login it keeps redirecting me to login page without showing any messages. Looking at http access logs, I can see that the website can not find the js files: 127.0.0.1 - - [07/Apr/2020:14:05:15 -0400] "GET /media/js/jquery-2.1.1.min.js HTTP/1.1" 404 487 "http://localhost/web/" "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0" 127.0.0.1 - - [07/Apr/2020:14:05:15 -0400] "GET

My (header,footer) and js,css,image,favicon load only in index method not in other in codeigniter

戏子无情 提交于 2021-02-11 15:54:09
问题 I am new to code igniter and integrating bootstrap template with code igniter. i have created several pages in template already and try to integrate it with CI. my css and js structure like below: application assets css/style.css js/min.js img/imagename.jpg My controller file as below <?php defined('BASEPATH') OR exit('No direct script access allowed'); class Welcome extends CI_Controller { public function index() { $this->load->helper('url'); $this->load->view('templates/header'); $this-

Suggestions on the search filter

与世无争的帅哥 提交于 2021-02-11 15:51:58
问题 I am working on a website in the codeigniter framework. I am stuck at a point where I need to implement the auto complete feature. I have tried a lot but I am not able to find proper solution so far. Here is what my actual requirements are. There is a page on website that has few search filters. When a person lands on this page all the users of the website are shown on that page. Here the real game starts. There is a filter or an input box that filters out the results on the basis of their