Reporting Problem

Reporting Problem

vinkey33vinkey33 Posts: 7Questions: 4Answers: 0

Hello, I have a problem of index not defined and I do not know how
<?php $servername = "localhost"; $username = "root"; $password = "Mm101010"; $dbname = "smartphone"; $conn = mysqli_connect($servername, $username, $password, $dbname) or die("Connection failed: " . mysqli_connect_error()); $requestData = $_REQUEST; $columns = array( 0 => 'USER_ID', 1 => 'Nom', 2 => 'Prenom', 3 => 'Num_SIM', 4 => 'PIN_Terminal', 5 => 'PIN_SIM', 6 => 'Num_IMEI', 7 => 'Date_Debut', 8 => 'Date_Fin', 8 => 'Vitre', 10 => 'Coque', 11 => 'Support_Vehicule', 12 => 'Actif', 13 => 'Statut' ); $sql = "SELECT Or_Affectation "; $sql.=" FROM vu_affect_empl"; $query=mysqli_query($conn, $sql) or die("Affectation.php: get employees"); $totalData = mysqli_num_rows($query); $totalFiltered = $totalData; $sql = "SELECT Or_Affectation, USER_ID, Nom, Prenom, Num_SIM, PIN_Terminal, PIN_SIM, Num_IMEI, Date_Debut, Date_Fin, Vitre, Coque, Support_Vehicule, Actif, Statut "; $sql.=" FROM vu_affect_empl WHERE 1=1"; if( !empty($requestData['search']['value']) ) { $sql.=" AND ( USER_ID LIKE '".$requestData['search']['value']."%' "; $sql.=" OR Num_SIM LIKE '".$requestData['search']['value']."%' "; $sql.=" OR Nom LIKE '".$requestData['search']['value']."%' )"; } $query=mysqli_query($conn, $sql) or die("Affectation.php: get employees"); $totalFiltered = mysqli_num_rows($query); $query=mysqli_query($conn, $sql) or die("Affectation.php: get employees"); $data = array(); $i=1+$requestData['start']; while( $row=mysqli_fetch_array($query) ) { $nestedData=array(); $nestedData[] = " #".$i ; $nestedData[] = $row["USER_ID"]; $nestedData[] = $row["Nom"]; $nestedData[] = $row["Prenom"]; $nestedData[] = $row["Num_SIM"]; $nestedData[] = $row["PIN_Terminal"]; $nestedData[] = $row["PIN_SIM"]; $nestedData[] = $row["Num_IMEI"]; $nestedData[] = $row["Date_Debut"]; $nestedData[] = $row["Date_Fin"]; $nestedData[] = $row["Vitre"]; $nestedData[] = $row["Coque"]; $nestedData[] = $row["Support_Vehicule"]; $nestedData[] = $row["Actif"]; $nestedData[] = $row["Statut"]; $data[] = $nestedData; $i++; } $json_data = array( "draw" => intval( $requestData['draw'] ), "recordsTotal" => intval( $totalData ), "recordsFiltered" => intval( $totalFiltered ), "data" => $data ); echo json_encode($json_data); ?>
Here is the error image

thx

4.PNG 13.1K

Answers

  • allanallan Posts: 61,726Questions: 1Answers: 10,110 Site admin

    Have you enabled serverSide in your DataTables initialisation?

    Allan

  • vinkey33vinkey33 Posts: 7Questions: 4Answers: 0

    yes, But I do not see what identified the variable with respect to the variable

  • allanallan Posts: 61,726Questions: 1Answers: 10,110 Site admin

    I don't really understand I'm afraid. The serverSide option tells DataTables to enter into server-side processing mode, whereby it will send the parameters described here to the server with each request (defined by ajax).

    Allan

This discussion has been closed.