I've got this code
Javascript
$http({
method: 'GET',
url: '../../php/getMesas.php',
}).then(function successCallback(response) {
$scope.mesas = response.data;
}, function errorCallback(response) {
$scope.mesas = 'No Response';
});
That is trying to get some table numbers, but when this really works it shows me the parameter name and the value, i need only the value, what can i do to get only the value so not the parameter name? I'm using PHP as database connector.
PHP Code
<?php
include('base.php');
$data = array();
$result = mysql_query('SELECT table_number FROM waiters_assigned ORDER BY id',$connect);
if(mysql_num_rows($result) > 0){
while($row = mysql_fetch_assoc($result)){
$data[] = $row;
}
} else {
echo "0 results";
};
echo json_encode($data);
mysql_close($connect);
?>
The result is this one: {"table_number":"3"} what i need is just: 3
mysql_functions are deprecated; use themysqli_ones.