how to get entire array from ajax call instead of single val from sqlVal()
Posted: 2019-09-10 22:56
Code: Select all
$j('#ID').change(function(){
p3 = $j('#ID').val();
$j.ajax({
url: 'hooks/ajax-copiadieta.php',
data: { p: p3 },
success: function(data){
if (data) {
console.log(data);
$j('#ID2').val(data);
}else{
console.log('nodata');
}
}
});
});
Code: Select all
$p = makesafe($_REQUEST['p']);
$sql = "SELECT ID FROM dietasuplib_new WHERE ID = '{$p}'";
$data1 = sqlValue($sql);
echo $data1;
how to return the entire array * from dietasuplib_new instead of single value using sqlVal() function?