I am running a query to database which fetch a row and i want to return it as array which can accessed as array['min'], array['max'] etc. if i echo it with specific index, it shows the value correctly in ajax but i am unable to pass complete row through it to the ajax file.
PHP file:
<?php
// Database logic here
$calid = reset($_POST);
require '../incs/connect.php';
$sql=mysqli_query($con, "SELECT * FROM calcus_sets WHERE sets_id=$calid ");
WHILE($row=mysqli_fetch_array($sql))
{
echo $row['min']; break;
}
mysqli_close($con);
?>
JS file:
function DB_Fetecher(ops){
$.ajax({
type: "POST",
data: {ops},
url: "calcus_es1-fetcher.php",
success: function(res)
{
// alert( res );
alert(res);
}
});
}
This code get right value from mysql but i want to pass full row to ajax and then use each index in ajax itself to put into textboxes.