How can I pass my console log result to my ajax so that i can insert it in DB?
23:55 21 Jun 2021

I am making a matchmaking system. My question is, how can I insert my console.log result into my database? The result from console.log happens when there's the same level in my DB.

, For example, testing 4 has level 1 and testing 1 has level 1. They'll be joined in 1 array because they have the same level

Same for the others also. I have provided my codes and screenshot of my target below. Any help will be appreciated. Thank you very much.

enter image description here

ajax fetch:


ajax insert:

// i want to pass my ajaxResult = []; here so that i can insert it into my database


    

controller:

function inserFunction() {

 $this->db->insert('matching', $data);   

}
javascript php ajax codeigniter codeigniter-3