I have a database column "days". After insert the days of the week randomly (example Tuesday,Monday,Thursday,Wednesday): | id | Days ------------------- | 1 | Tuesday | 2 | Monday | 3 | Thursday | 4 | Wednesday How would I return the days ...
I need some help constructing query involving multiple tables. I have 3 tables: table name columns relating column film film_id, filmname PK film_id film_category film_id, category_id FPKs film_id and category_id category category_id, categoryname PK category_id The problem is that I want to "select all filmname from ...
I would like to get industry of a candidate from the database for that I have written the following: $candidateID = '1,2,3,4,5,6,7,8,9'; function get_industry($candidateID) { $this->db->select('current_industry'); $this->db->group_by('current_industry'); $this->db->from('candidate_details'); ...
I’m working on a PHP web application that generates reports from a MySQL table with over 1 million rows. What I’m trying to do: Fetch a large dataset and process it to generate a downloadable report (CSV format). Improve speed and reduce memory ...
I want to ask if I need to do this query in my app select qty, type from tItem where qty=0 and (type=1 or price=100) How do I do that using active record in CodeIgniter? because if I do $this->db->where('qty','0'); $this->db->where('type','1'); $this->db->or_where('price','100'); the query would be ...
I want to calculate the time difference. I’ve tried query() and the query work on MySQL. SELECT *, CONCAT_WS(" ", date1, hour1) AS rhour1, CONCAT_WS(" ", date2, hour2) AS rhour2, ...
I have recently begun converting my backend queries in my codeigniter application to active record pattern. As of now I am using codeigniter 2.1 version. I have originally written a query in mysql as SELECT * FROM table WHERE (field1 = $field1 OR ...