Json data table problem
Json data table problem
ertugrul
Posts: 6Questions: 3Answers: 0
Json data table problem
The json data table looks this way. Thank you for your help.
This discussion has been closed.
Answers
We need to see both your data structure and your DataTable deleration to see what the issue is.
//PHP codes
$sql="select Y_Talep_Gida,Y_Talep_Giyim,Y_Talep_Odun,Y_Talep_Kirtasiye,Y_Talep_Ev_Esyasi,Y_Talep_Ev_Tadilati,
Y_Talep_Ev_Temizlik,Y_Talep_Banyo_ihtiyaci,Tc_No,T_Talep_Gida,T_Talep_Giyim,T_Talep_Odun,T_Talep_Kirtasiye,T_Talep_Ev_Esyasi,T_Talep_Ev_Tadilati,T_Talep_Ev_Temizlik,T_Talep_Banyo_ihtiyaci,T_Durumu
FROM anket_veri where Tc_No=".$_POST["Tc_No"]." and sonuc='Komisyonda'";
$verial=$pdo->prepare($sql);
$verial->execute();
$sonuc_T=array();
for ($i=0;$i<$tp_kln;$i++)
{ if ($icrk[$mt['name']]=="var" && $mt['name'][0]=="T" )
{
$sonuc_T[]=[substr($mt['name'],8)];
}
}
echo json_encode($sonuc_T);_
//JavaScript codes
var jDt = $.ajax({
type: "POST",
url: "komisyon_sorgu_data.php",
dataType: "json",
async: false,
data: {
Tc_No: ara,
},
}).responseText;
var dt = dr1;
do you really need to make a synchronous ajax call? It is discourage in most situations because it locks up the browser and irritates users.