Tagged Questions
-4
votes
1answer
34 views
Form Helper Drop Down Menu
Is there a way to create a MySQL linked dropdown menu using the form helper in CodeIgniter? I tried to do it but I cannot seem to get it to work.
Model
function get_airports()
{
...
0
votes
1answer
41 views
I can't decide how to structure my table
I'm building a website where basically there will be forms with multiple fields, to make user input really specific, instead of it all coming down in a single paragraph.
So I'm thinking maybe I'll ...
1
vote
2answers
12 views
code igniter SQL_CALC_FOUND_ROWS
How to get total number of rows for particular query and also limiting the query results to 10 rows. For example. I've a table called sample. It has 400 rows. On running a query like where name = ...
2
votes
2answers
54 views
Creating complex IF, OR, NOT & AND SQL queries (MySQL)
(Apologies if this a duplicate - I have tried searching, but I may not know the right word for what I'm trying to achieve - feel free to correct me!)
The Background
So I have a PHP based app ...
0
votes
2answers
16 views
Translate Wilson Score Confidence SQL Code to Codeigniter active record
I can't seem to translate the Wilson Score Confidence SQL code to Codeigniter active record code. Here is the ordinary SQL for the Wilson Score Confidence:
SELECT *, ((likes+ 1.9208) / (likes + ...
0
votes
5answers
75 views
for loop through php array
Guys this is the complete code:
$response = $this->db->select('DATE(`created_at`) as `day`')->select('MIN(`paid_amount`) as `min_amount`')->select('MAX(`paid_amount`) as ...
0
votes
3answers
39 views
Perform sql operations for this special case
Sir,
I am facing a problem and it is shown below:
I want to perform where opertion on the output of $this->db->select('*')->from('table'); only when cond1 satisfies
$result = ...
0
votes
4answers
35 views
Model PHP SQL IF Statement Not Working
I am unsur why the below statement is not working basically in a nutshell I am wanting it to run the $result statement if only the $product_id is not found in the $images table. Is it is found I ...
0
votes
1answer
29 views
Date comparison in codeignitor
Hi frdz,
function customer_get()
{
$this->db->select('user_id,first_name,last_name,email');
$this->db->from('customers');
...
0
votes
1answer
39 views
Code Igniter SQL Query: how to create this query
This is the first time I will be using a MVC and i have read the documentation of code igniter.. but i cant seem to get this query right:
$score = $_POST['time'];
$sql = "SELECT COUNT(score) as c ...
1
vote
1answer
34 views
how to get an array of unique key and associated value from multidimensional array with multiple keys and values
I'm firing a query on a particular table and getting this result :
$results = array(3) {
[0]=>
array(2) {
["category"]=>
string(1) "1"
...
0
votes
1answer
56 views
Protecting from SQL injection
I know the below code is open to injection but I am unsure what the best way to resolve it. Would it be best to repeat the $new_id line or is there something more that should be done?
Controller:
...
0
votes
2answers
24 views
Codeigniter Joining Tables - Passing Parameters
I'm attempting to join two tables while using codeigniter. I've done this same SQL query writing regular SQL. When I attempt to do the same in codeigniter, I keep getting errors. I'm not quite sure ...
0
votes
0answers
21 views
codeigniter: pagination edit query
i have my pagination
Controller:
$this->load->library('pagination', TRUE);
$conf['base_url'] = "http://localhost/projecto/index.php/produto_serv_c/list_produto_serv";
...
0
votes
3answers
36 views
Codeigniter function returning an empty query
I have this function on my model, which receives a parameter so I can pre-load some information on the view page, but somehow is coming back empty:
function addTicket($idt)
{
//Db ...