AJAX ARRAY |
Hello there. I'm from Turkey. I use google translate because i don't speak english.
I am sending an array to the Controller with AJAX. There are 3 different IDs in the array I sent. I will pull data from the database with these IDs, but I don't know how to separate them. Ajax Code: $.ajax({ Controller Code: public function o_getir() { Model Code: public function o_get2($data) { IDs in Array ![]() The data I want to bring from the database. ![]() The data of each ID must be in different arrays.
You need to use json_decode to convert the json array into a php associated array.
Then you can get the values you need. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
I was able to export the data to the array variable in the model file.
My Model Code: public function o_get2($data) { Print: Array ( [0] => Array ( [0] => S [1] => M [2] => L [3] => XL ) [1] => Array ( [0] => Kırmızı [1] => Sarı [2] => Yeşil ) ) but i can't print it on controller. Controller??? Code: public function o_getir() {
Maybe this will help you.
How to Handle AJAX request on the Same Page – PHP What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |