Questions tagged [codeigniter-query-builder]

95 questions
0
votes
1 answer

Select operated value by multi columns from MySQL using Model in CI4

I want to get column of operated value with multi columns from MySQL in CI4 project. Here is what I tried. There are 3 fields qty, size, unit_price in table products and I want to get multiplied value of all of these 3 fields. class ProductModel…
0
votes
1 answer

Unknown column 'created_at' in 'field list' Code Igniter4

So I want to insert some data in my database that has timestamp in it, but when I insert the data it keeps telling me Unknown column 'created_at' in 'field list' although I don't have any variable , function or table column called created_at. This…
0
votes
0 answers

Find a Customer that buys only specific products & did not buy any other products in codeigniter query

customers table | id | name | email | | 1 | richa| richa@gmail.com |`` | 2 | sam | sam@gmail.com | | 3 | hella| hella@gmail.com | orders table | id | customer_id | | 101 | 1 | | 102 | 2 | | 103 | 3…
0
votes
2 answers

What is the equivalent of ORDER BY FIELD in Codeigniter 4

I tried several methods but couldn't get the right result. ORDER BY FIELD(c.id, '1,0,3,4') What is the equivalent in query builder? Do you have any suggestions?
0
votes
1 answer

How to select data from 2 differenet tables using Codeigniter?

I want to select id from 2 different tables and use the id which is present in both the tables. seller id | name | mobile_number | password | is_active 1 | abc | 987654321 | 12345678 | 0 2 | pqr | 989898989 | 12345678 | 1 3 | lmn …
0
votes
2 answers

Codeigniter setflash data wont clear after refresh

hi everyone who had an idea on how to clear the setflashdata? im just new at codeigniter Framework. This is my Controller view that has the submit function and view for the page add view Controller:- public function add(){ …
0
votes
1 answer

Problem with codeigniter 4 Query builder classes

On terminal, in mysql , running the following query gives this result mysql> SELECT DISTINCT(city) FROM outlets_data; +-----------+ | city | +-----------+ | Paris | | New York | | Kolkata | | Moscow | | Mumbai | | Hyderabad | |…
kashish
  • 159
  • 4
  • 12
0
votes
2 answers

Codeigniter:Update Image and Display Current image if I don't want to update old image

I'm stuck on a problem with updating image. I've created image upload which works fine but I also want it to be updated. When I add a need image it updates correctly but I if don't want to change the image and leave it as it is, then my current…
0
votes
2 answers

Show sub-options based on selected main option in Codeigniter by ajax

I would like when I select the cats option that only the breed of cats appears, such as the Siamese example. If I select dog, I only want to get the breed of dogs, such as Pitbull and others. Can you help me with the code, it tells me to use jquery,…
DASE
  • 23
  • 5
0
votes
1 answer

How insert Multiple checkbox value in codeigniter

I need to insert multiple values in the checkbox in Codeigniter. how I can write this in the controller. I tried so many but the values not inserting . View.Php
M…
0
votes
1 answer

How can we upload multiple images from a Form to Database using a single Submit Button?

I am preparing a CMS which has Mission, Vision, and Why_Us section. I want that while editing I should be uploading three images separately with different text fields provided against each section. The entire entry and the images should reflect in…
0
votes
2 answers

Codeigniter updating data with OR condition in ID

Hello I am a beginner in using Codeigniter. What I want is to update a data in Codeigniter with an OR condition to the ID. Here is my MySQL query that I want to make happen: Update message_received SET is_read = 1 WHERE msg_id = 3 OR parent_id =…
0
votes
0 answers

Weird internal server error in codeigniter

Why I'm getting an error status code of 500 Internal Server error while the query seems to work? Here's what I found out, when I remove the ->result(); in my query it returns status 200 which is good. But if I add ->result(); in my query it gives me…
Jc John
  • 1,799
  • 2
  • 34
  • 69
0
votes
2 answers

Codeigniter increase value in database from array with only one component escaped

I need to increase the value of a field in my CodeIgniter database. I understand that CI allows not to escape values, setting as FALSE the third parameter in $this->db->set(). I am inserting multiple data from an array, and as I understand, it would…
0
votes
0 answers

Weird Codeigniter query builder bug when running Select query

I'm working on a query that checks if a user exists in the database. The query returns an error : "Table inventory_db.tbl_userss' doesn't exists". The problem is in my code I'm cleary stating that the table name is just tbl_users not tbl_userss.…