Tagged Questions
1
vote
1answer
21 views
#CodeIgniter Sending each “checked” check box values from multiple checkboxes to the database?
I have populated check boxes from database as follows...
View:
<div class="control-group warning">
<label for="room_number" class="control-label">Room Number: </label>
...
0
votes
1answer
32 views
What is a dictionary table in SQL?
I have to build this retail site, and aparently all the properties info comes from a third party company. Everything looked fine, they sent me a .mdb file with all the tables (which convert to a .sql ...
0
votes
3answers
29 views
How to get data from database by using $query->result() in codeigniter without foreach loop?
I have just started using CodeIgniter and want to get data from database using $query->result(), but without a foreach loop. Here is my current code:
$this->db->select('m_name');
...
1
vote
1answer
25 views
php codeigniter mysql joins
Ok so im working on my first ever php/mysql project having come from a software position. I am learning codeigniter and i have worked out that this mysql join will get me friends statuses based on an ...
2
votes
1answer
25 views
CodeIgniter SQL search (like) giving priority for column
I'm using CodeIgniter and active record. I have posts table:
id | title | body | accepted | deleted
Once user is typing a word, 6 posts matching database will be suggested if it is inside title or ...
0
votes
0answers
28 views
CodeIgniter modifications extending database drivers for using them with UNION queries
My goal is to use UNION queries in CodeIgniter Active Record.
Some people suggested to me to use the method $this->db->last_query(); to get the queries I want, then combining it with UNION.
Problem ...
0
votes
2answers
29 views
convert following MySQL query into Codeigniter Active Records
I`m new to codeigniter and I like to convert following MySQL queries into Codeigniter Active Record Queries.
'SELECT name, address, detail, status, startdate, FROM job_step WHERE username = ...
0
votes
5answers
213 views
in codeigniter, I need to use count in such a way that
I need to call a query and get numbers of some occurances. in other words I need a CodeIgnıter method such that query produces comething like :
SELECT COUNT( * ) AS total FROM comments WHERE `level`= ...
3
votes
7answers
62 views
Formatting a PHP array for an SQL “IN” clause
I'm attempting to query a database for records where the "product_id" is included in an array of products IDs.
The array is the post result of a multiple select input (<select>) and looks like:
...
0
votes
3answers
28 views
Codeigniter nested query in cycle
I have a site devloped in codeigniter where I'd want to create a query with some condition and a condition inside with OR like this:
Select * from users where username = 'user' and nation_id = 90 and ...
0
votes
1answer
30 views
Replacing a string with another in the database result using CodeIgniter
I have a database table containing some Permanent Texts which I will be outputting to my user interactions. The problem is that I need to change some parts of these Permanent Text answers when ...
0
votes
2answers
29 views
Combined conditions in CI ActiveRecord
I want to do a sql query like
select * where x = 10 and (y=12 or h=15)
How can I achieve that in CI ActiveRecord format?
0
votes
2answers
26 views
how do i ignore the backticks in codeigniter when using active records? i need to order by cases
how do i ignore the backticks in codeigniter when using active records? i need to order by cases
case when roll_number is null then 1 else 0 end,
which code igniter makes it as
ORDER BY `case` ...
0
votes
2answers
37 views
Insert results of DB query into a variable in controller - CODEIGNITER
I have two tables.
The finalists table which lists the finalists with fields such as ID, Name.
The Votes table which stores the votes for those finalists.
One row in the vote tables where the field ...
1
vote
3answers
26 views
Codeigniter Active Record where value in JSON object
I have a question to ask. Firstly, I have a table, where the parent has parent_id is 0 and the child has parent_id equal parent id. parent_id of all children are stored as a json encoded array (one ...