Questions tagged [codeigniter-query-builder]

95 questions
1
vote
1 answer

How model can save data from controller in Codeigniter

I have a web application that need to send message to many friends.But i suffer an error..please help me.... Here below is the my controller public function message(){ $this->form_validation->set_rules('message','Message',…
1
vote
2 answers

Error:In displaying the contents from the databse on to the webpage (CMS site)

I'm working on a CMS website, I have got one issue which I'm trying to fix it from saturday, but im unable to know why such error is coming. I'm getting an error like this Error: A PHP Error was encountered Severity: Notice Message:…
1
vote
1 answer

Display data from three tables with common id in foreach

So I currently have three tables like this given below: AI = auto increment. ci_users: user_id(AI), username, slug, email, biography. ci_terms: term_id(AI), title, slug, body. ci_relationship: id(AI), term_id, user_id, type. I'm trying to display…
1
vote
3 answers

How to display total in view page (Codeigniter)

I am just new to Codeigniter. I want to display the total sum of bill_rpt of this SQL query in the view page. here's the code this is my Model public function total() { $sql="SELECT bill_rpt FROM amilyar_bill WHERE bill_status = 1"; …
1
vote
1 answer

How to select rows from a table using join query in codeigniter?

I have two table competition_registration and competition_schedule. I have wa select query for selecting rows from competition_registration. this is my code as shown…
1
vote
2 answers

Getting data by ajax in Codeigniter

I am adding record to database by ajax in CI , so i was trying to return the id of the new record but it's not working , the record has been added but no id is returned .(in ajax code am trying to alert the new record id but it's alerting…
1
vote
1 answer

Acessing num_rows in codeigniter and return to ajax

This is my Model: public function fetch_customer_invoice($f_date,$t_date) { $this->db->select('invoice_id'); $this->db->from('invoice'); $this->db->where('date >=',$f_date); $this->db->where('date <=',$t_date); $res=$this->db->get(); …
1
vote
1 answer

Codeigniter $query->row_array() SQL $query->result_array()

So I am trying to get a single item data like itemID, itemSKU etc. from multiple tables. And display in the view. The example item I provided down below has three images attached.If I use return $query->row_array(); I will get only one row…
1
vote
1 answer

error in updating records using codeigniter

i'm trying to update my records which are stored in the database, but unfortunately i'm getting errors like (given below) this please can any one help me in this it would be help full for me A PHP Error was encountered Severity: Notice Message:…
1
vote
1 answer

SELECT inside SELCT in active record codeigniter

I want to calculate the time difference I've tried query and query work on mysql SELECT *, CONCAT_WS(" ", date1, hour1) AS rhour1, CONCAT_WS(" ", date2, hour2) AS rhour2, (SELECT TIMEDIFF(rhour2,rhour1) AS diffhour) from TABLE1 and I write in…
1
vote
1 answer

I want to build an advanced query in codeigniter

I want to build a query nested in codeigniter here is the my controller public function advancedSearch(){ if (!$this->session->userdata('logged_in')) { redirect('main/login', 'refresh'); } $session_data =…
1
vote
1 answer

Codeigniter - Sql Databases

I use 2 tables. First one of the table is Department. I want to show Departments to in User's Profile Page. The user can edit Department in Profile Page. But firstly he can see own department in Profile Page and Profile Edit Page. But There is…
1
vote
0 answers

Showing 3 tables Codeigniter

image of my database table 3 tables this is the layout from my web.data in table 'pembayaran_infaq' is only 1 row but this is duplicate duploicate data from table 'pembayaran_spp' and 'pembayaran_infaq' in database data from database im already…
1
vote
1 answer

Crud in Codeigniter not affected when Update to database

I've been working to make some CRUD I get nothing wrong. But when I update data I got nothing affected in database and here my code Table : Song Column : id_song, id_album, song, author, composer Code for my Model is below: function…
0
votes
1 answer

Codeigniter Postgres JSON array of selected rows from a joined table

Note: I edited the question to better reflect what I'm after. I suspect I need a subquery inside the json_agg that outputs date objects grouped by date but I have no idea how to do that. I have 3 tables tagger table [id(primary key), userid, other…