DataTables -> SQL Querry ->Array -> Add to DataTables

DataTables -> SQL Querry ->Array -> Add to DataTables

M4D1S0NM4D1S0N Posts: 2Questions: 1Answers: 0
edited October 2022 in Free community support

Hello,

I get an Array from a mySQL querry. Here is an example:

Array
(
    [0] => Array
        (
            [it_ip] => 192.168.0.100
            [it_name] => FUJITSU PRIMERGY TX200 S7
            [it_intname] => SERVER
        )

)

Other Arrays are filled with 10+ results.

Now I want to add this into my DataTable.

Code-Snippet:

$.ajax({
      type:'POST',
      url:'index.php',
      data: { action: 'it_ipaddresses_select', id: id },
      success: (function(data) {

        alert(data);

      }), });
      return false;

Can anyone help me to fill the DataTable "#dt" with the results from the arrray?

Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.

Answers

Sign In or Register to comment.