Questions tagged [codeigniter-query-builder]

95 questions
0
votes
2 answers

Fatal error: Call to a member function row_array() on boolean

Please i have an issue with codeigniter. when i try to log here is the result Below is the my code : $sub_and = ''; if($this->location_parent == 0){ $sub_and = "and g.idlocation_fk IN (".$locids.")"; }else{ $sub_and =…
0
votes
1 answer

How to check for Array in Database CodeIgniter and if they don't exist Add them

So I just want to insert the data if the typed data does not exist and/or remove them if users decides to remove them; the problem is that it checks for more > 1 value. This should be my last question of three in total(see my last two question on…
0
votes
1 answer

codeigniter library with database connection

I am creating a new custom library with database connection but am unable to load the database This is my custom library : class Seo { var $CI; public function __construct($params = array()) { $this->CI =& get_instance(); …
0
votes
1 answer

Display posts according to category ID from pivot table in CodeIgniter

I currently have three tables like this : ci_posts: id, title, slug, content. ci_terms: term_id, title, slug. ci_relationship: id, post_id, term_id I'm trying to retrieve all the posts according to the specific clicked category. This is my method…
0
votes
1 answer

select query doesn't give result in codeigniter?

Select query don't show records array. Below is my get_all_user method code. public function get_all_user(){ $query = $this->db->query("select * from user"); echo"
";print_r($query);die;
}

when i print $query it shows result_array()…
0
votes
4 answers

unable to fetch image from the database

I am trying to display images on my web page, the content is getting fetched from my database, but the issue I'm facing is in displaying the image. please, can anyone guide me how should I display the image? I mean to say the path what I should…
0
votes
1 answer

Too few arguments to function CI_DB_query_builder::join(), 1 passed and at least 2 expected using join table in PHP(Codeigniter)

I am trying to reduce all my methods in my model so I decided to make it a dynamic. Done in creating a dynamic for insert,update,fetch,delete but having a problem in creating a dynamic for joining 2 tables. Error encountered: "Too few arguments…
Angel
  • 966
  • 4
  • 25
  • 60
0
votes
2 answers

fetch data from the database using codeigniter

i have uploaded a image and related content for it in the database, now im trying to fetch it from their and display it on my webpage, but im getting some errors while fetching it , so please can any one help me where im going wrong? i don know the…
0
votes
3 answers

Code Igniter - Trying to get property of a non object

I am trying to implement cart functionality in codeigniter. In my controller I have a public function add and in my model a public function called get to fetch data from database according to the product selected. here is my Controller public…
0
votes
2 answers

How to use sum, join, order by and where clause in mysql?

So I have two tables like given below: tb_custmap: idCust, idUser tb_cust: idCust, revenue I want to get the revenue from tb_cust based on the idCust and only from specific idUser. I've tried this: SELECT tb_cust.revenue FROM tb_custmap INNER…
0
votes
1 answer

how to view individual field of the table in codeigniter

I have created following table in mysql I want to retrieve one of the field i.e abstract or author or Title by using id dynamically in view field. These are my model, controller and view code. Model:This is my model $this->db->select("*"); …
-1
votes
1 answer

CodeIgniter 3 code does not add data to database into 2 different tables (user_info & phone_info)

The problem is when I entered a new name no data is added. A similar thing happen when I entered an already existing name. Still, no data is added to the database. I am still new to CodeIgniter and not entirely sure my query builder inside the model…
-1
votes
1 answer

is there a way of creating a connection between codeigniter 3 and sql server using php version 7.2

what is way i can use to create a connection between codeigniter and sql server? below is the way i was connecting but it seems not to work $active_group = 'default'; $query_builder = TRUE; $db['default'] = array( 'dsn' => '', 'hostname' =>…
-1
votes
2 answers

Query Order By in Codeigniter

How can display thus code in order by in Codeigniter
-1
votes
2 answers

Codeigniter count_all_results with having

I have composed a query using Codeigniter's Query Builder class. The query utilizes aliases and the having method. When I call the count_all_results method on this query, an exception occurs. Inspecting the log, I see that the query has stripped out…
Enoch
  • 202
  • 1
  • 10