0
votes
1answer
47 views

How to loop through two different tables?

I've been thinking about this for hours now and can't find a solution. I googled and searched all over stackoverflow for a duplicate question and couldnt find one. (Since I'm not a native english ...
0
votes
1answer
28 views

Dynamic Custom CodeIgniter Config File

I have created a custom configuration file for my custom CMS I am building using CodeIgniter. I want to have a "Configuration" page in the CMS that allows the user to save a contact email address and ...
0
votes
1answer
27 views

Undefined offset: 0 CodeIgniter [closed]

A PHP Error was encountered Severity: Notice Message: Undefined offset: 0 Filename: master/header.php Line Number: 235 and here's the code <?php print ...
0
votes
1answer
22 views

Show valid JSON array from query

I have a function to show a JSON array containing multiple registration id and data. I am using CodeIgniter. I tried to use notification using this library. public function ...
-1
votes
2answers
66 views

Populate option list from database

In my DB table row() I have "24, 26, 28, 30" size in 'product_size' column. After query, I want to view in viewProduct.php page like: <'option value=" ">' size <'/option>`<br /> ...
0
votes
3answers
59 views

Inserting array element using foreach

Hi i am working on a simple script where i would like to output the result of a given SQL query into JSON. This is what i have so far: $player = $this->game->getPlayer(5); $leaderboard= ...
0
votes
1answer
55 views

Set multiple values as selected in form_multiselect() in codeigniter

I wonder if there's a way of setting multiple (say 3) values 'selected' in form_multiselect(). I got it working with only 1 value using key($selectie) where $selectie is my query to get the values ...
0
votes
1answer
38 views

How to add Array to database in codeigniter?

I have a form with a multiselect field. I choose 3 categories for each company, but only one is added to the database. How can I add an Array of 3 categories to my database? I use a joined table to ...
3
votes
1answer
56 views

Codeigniter Database results - Objects or Arrays?

I've been using Codeigniter for a good while now and i've often wondered which/whether to use Codeigniter's $query->result() or $query->result_array() Personally, I've tended to stick with ...
0
votes
1answer
23 views

array within array error during upload in codeigniter

I am getting problem while accessing array in views.... This is the function in controller public function go() { if(isset($_POST['go'])) { $config['upload_path'] = './uploads/'; /* NB! create ...
-1
votes
1answer
53 views

Passing arrays from AJAX to HTML to PHP - Is this Possible?

I have an AJAX call returning an array to a PHP-HTML page. Here are some blocks of codes: Javascript: "Note: get_data.php returns an HTML string, and I want to store it in an array." var ...
0
votes
1answer
79 views

Codeigniter - Input post array insert into mysql database

I dont understand how to exactly insert a row into a MySQL table. If I use my code, I add a new row for every post. Rather than that, I want only one row with all the values. Here is the code sample. ...
0
votes
2answers
50 views

How to fill an array with a function, and use that array outside the function?

I'am working in CodeIgniter (CI), and trying to create a nested set of category items for a dropdown list. To create a dropdown box, in CI you need to echo form_dropdown('name', $array, $selectedID). ...
0
votes
2answers
45 views

codeigniter update table row with new data array where

I have a database record with a uniqueID/PrimaryKe (OrderNumber) I want to update the record with new data for that same PrimaryKey, OrderNumber. My Controller is: $data = array( ...
0
votes
2answers
36 views

Display database array lines whilst autoincrementing id per line

I wish to display the results of a database query in my view whilst giving each row a unique ID. My model is: function get_load_lines($ordernumber) { ...
-1
votes
2answers
78 views

to fetch array key and compare wih a key in a different array in php

I have a table that stores subjects offered and a table that stores the results scored by the students in an exam, in displaying the results using a view table, I want the system to display a (-) ...
0
votes
1answer
46 views

Convert array objects to string and separate the values

I have the following result Array ( [0] => stdClass Object ( [name] => Identification ) [1] => stdClass Object ( [name] => Assay ) [2] => stdClass Object ( [name] => ...
-3
votes
2answers
41 views

Pick 2 items with same contestId from multidimensional array [closed]

I want to pull 2 videos from this array of videos that share the same contest id. Doesn't matter what the contest ID is, as long as both of the items share the same value. This might be easy but I'm ...
0
votes
2answers
66 views

cant get associative array variables from cookies in codeigniter

i seem to be stuck at this problem for quiet a few time, basically i have used cookie in codeigniter, and passed an array with different names to different functions, the code to set the cookie is ...
1
vote
2answers
69 views

CodeIgniter - Sending array from model to controller to page [closed]

I am trying to pass the array to the view page and put the items in a listbox/dropdown. Where am I going wrong in this code? Model public function get_suppliers(){ $type = "SUPPLIER"; ...
0
votes
0answers
44 views

array manipulation in codeigniter

I'm currently working for a treeview using codeigniter and jquery. I've been struck for couple of hours please suggest any trick how to manipulate array or any suggestion that can bring out a output ...
0
votes
1answer
41 views

How to return value of 2 data in foreach which each data has 5 rows in model of codeigniter to view

I have a similar problem that the function only return the first loop data. The result should be 2 loops and each loop has rows data. For example, The first loop is A and has 5 rows data and second ...
1
vote
3answers
55 views

how to check the value of an array in codeigniter

$result=array(); $count = count($days); for($i=0;$i<$count-1; $i++) { $bookDate = $days[$i]; $fromDate = $this->booking_model->Get_BookedDate($bookDate,$roomname); ...
0
votes
2answers
46 views

How to sort an array created by the directory_helper in CodeIgniter

So I'm using the directory_map function in the Directory Helper and I'm wondering how I can edit that function (or maybe extend it or something) so that it sorts the multidimensional array it gives ...
0
votes
1answer
37 views

add post data to an array in controller and output from view with Codeigniter

I have the following syntax: Contoller function new_auto_spread_details() { $postinfo = array(); $postinfo[] = $this->input->post('customer') $postinfo[] = ...
0
votes
1answer
49 views

How do I reference this variable?

The following will grab a result from a mysql line (with about 25 entries of data in an array) $data['records'] = $this->testingsearch->getMessages($id); If I call it in a View after passing ...
1
vote
1answer
40 views

How can I access these data returned by the result_array() function from a PDO query in CodeIgniter? [closed]

public function get_details($id) { //my query in pdo form getting my records $query = $this->db->query("SELECT * FROM users WHERE idno='". $id ."'"); //check if query is ...
0
votes
1answer
51 views

Codeigniter Datamapper ORM issue with array and object?

I have a block code: // Creat a object $privilege = new Privilege(); // Get all privileges $privilege->get_iterated(); $privileges = $privilege->all_to_array(array('id', ...
-2
votes
1answer
91 views

Trying to pass multi-dimensional array to view with Codeigniter?

Simple stuff but my brain is blocked up and I can't work it out. Here's what builds the array in the controller: foreach ($rows as $row) { $slugs[] = $row->slug; } $data['slugs'] = $slugs; ...
-7
votes
1answer
76 views

How to add first score of each users [closed]

i want each first score of each users score should get added.Like wise second score of each users second score should be added [0] => stdClass Object ( [user_id] => ...
-1
votes
2answers
45 views

appending array in php / codigniter [closed]

I am try to append my data array in if conditions. I am using array_push function to do it Its first time I am using this function for appending array. I am using conditions so that if user has added ...
0
votes
1answer
76 views

Checking if value in array is greater then a number

I am working on a HTML email, I need to attach forms, but attach forms that have a value less then or equal to 37 (<= 37) I think I sorta figured out my problem that I am having with this piece ...
-1
votes
3answers
49 views

How pass array and variables to view in codigniter

i want to pass an array and two variables to my view my array is passed in views successfully but the two variable is undefined.can anyone help me how to pass those values to view.i tried ...
0
votes
3answers
51 views

Getting human readable names for forms

I have been working on this for the past 4 hours, with problem after problem. Now that I have finally come to the end of most of my problems, I can't seem to get a solution to the final problem. ...
1
vote
0answers
57 views

Display tagged items in lists sorted by tags

I have tasks that have tags in this format: Array ( [0] => stdClass Object ( [task_id] => 10, [task_text] => Mow and fertilize, [tags] => Array ...
0
votes
1answer
63 views

Looping through 2 different arrays to check if a value exists

Ok well i have this array that consists of 3 arrays of objects so its looks like $invoice $invoice->foo $invoice->foo->bars $invoice->bars $invoice->foobars i have all the foo bars ...
0
votes
3answers
60 views

Issue comparing two exploded php arrays to find overlap

I'm comparing the results of two exploded strings (results from a query), though when I use array_intersect to find the overlap of the arrays, I unfortunately only receive the overlap of those tags ...
0
votes
2answers
74 views

Codeigniter Value Not Setting

I am having an issue with my code and that is that on submit the selected value for user_support_documentaries is not being submitted to the array I can view the HTML source before page submit and ...
0
votes
1answer
93 views

Validating Dynamically generated field arrays in codeigniter

i have a form where some fields are dynamically generated. <table class="insideform"> <tr> <td> ...
2
votes
3answers
198 views

Foreach in Multi-Dimensional Array

I'm trying to practice/learn foreach loops in PHP. I understand basic foreach. But I struggle with multi-dimensionals. I have an array to test it out: $data = array( array('New York', 'New ...
1
vote
1answer
83 views

Upload Multiple Image Files In CodeIgniter [duplicate]

I have to upload multiple images in CodeIgniter. The result of var_dump($_FILES) is : array 'organizer_logo' => array 'name' => array 0 ...
1
vote
2answers
70 views

Looping over checkboxes -PHP

I have a page with around 50 input check boxes, of which their name="form[]" I need my php script to be able to loop through all the check boxes and which ever ones are checked and submitted I ...
0
votes
1answer
57 views

Codeigniter pass post information to view along with database result of the post information

I have a form that collects the CustomerName, Period and UnitOfMeasure[buom]. I then pass this information to my controller which puts the post data into an array and passes it to the view. This ...
0
votes
3answers
48 views

CodeIgniter variables in constructor

I looked up the topics around, but I didn't see something for my case. So, I have controller filled up with methods, and a construcor which loads the models that i commonly use in this specific ...
0
votes
1answer
26 views

Error to populate CI's Dropdown (form_helper)

This is my attempt to try to populate CI's dropdown (using the from helper): foreach ($freetables as $t) : $tableNo = $t['tableNo']; $tableDescription = ...
3
votes
4answers
281 views

Get all categories (multilevel)

I'm using codeigniter and have a table with 3 columns (id, name, parent_id). A category can have many subcategories and a subcategory can have many sub-sub categories. I've been trying to get all ...
-3
votes
1answer
56 views

Undefined Offset error in Codeigniter [closed]

here is my code // undefined offset error <tr> <?php $i = 0; foreach($all_sb AS $row=>$v) { ?> <tr> <td> <div ...
1
vote
1answer
59 views

Codeigniter objects and arrays

When returning things from the database, by default Codeigniter methods return objects (i.e. $this->db->result() vs $this->db->result_array(), and the same for row/row_array). I'm a ...
1
vote
1answer
48 views

Remove item from session info

I am writing this project with CodeIgniter, where you can add and remove items from your bucket, like an internet shop. I have an array inside my session class, what I'm trying to do is to search the ...
0
votes
2answers
103 views

Outputting two dimensional array - CodeIgniter

I'm trying to match subcategories with their respective parent categories. For now I just hard-coded in the main categories on the view (Books, Clothes etc) and have a function to get all ...

1 2 3 4 5 7
15 30 50 per page