I just uploaded my project to a server, but it turns out that I get a response from the server (Status: 500), this is a short query on my home page regarding the cities:
I have read about it and I have found that it may be because of the .htacces but I have not implemented it yet, so I discard that option, and the log does not return any error either
<?php
header("Context-type: application/json;");
require '../conexion.php';
$mysqli->set_charset('utf8');
$resultadoConsultaCiudad = $mysqli->query("SELECT cdes.id_ciudad,
cdes.ciudad,
dpto.id_departamento,
dpto.departamento
FROM ciudades cdes
INNER JOIN departamento dpto
ON dpto.id_departamento = cdes.id_departamento");
$dataSalidaCiudad = array();
while ($row = $resultadoConsultaCiudad->fetch_assoc())
{
$dataSalidaCiudad[] = $row;
}
echo json_encode($dataSalidaCiudad);
?>
This is the client part (AngularJS):
//FUNCION QUE SE ENCARGA DE OBTENER LOS DATOS DE LA TABLA CIUDAD
$scope.importarDatosCiudad = function()
{
$http({
method: 'GET',
url: 'mainApp/Read/consultarCiudades.php'
})
.then(function successCallback(datosCiudad)
{
$scope.tableCiudades = datosCiudad.data;
},function errorCallback(datosCiudad)
{
console.log("Error, al tratar de traer los datoss", datosCiudad)
});
}
$scope.importarDatosCiudad();
result:
{data: "", status: 500, config: {...}, statusText: "Internal Server Error ", headers: ƒ} config: {method:" GET ", transformRequest: Array (1), transformResponse: Array (1), jsonpCallbackParam: "callback", paramSerializer: ƒ, ...} data: "" headers: ƒ (d) status: 500 statusText: "Internal Server Error" proto : Object