Problem with dependent clerks

0

I have a problem trying to nest two select, this is my file up there all right, if I give a echo to the variable $ data it is showing me the id of the select that I'm selecting ajax.php

public function obteneridpais(){
        $datos = $this->valor_id_pais;
        $respuesta=Controller::SelectCiudadescontroller($datos);

        echo $respuesta;
    }

The problem is as soon as I want to pass that value to the SelectCiudadescontroller function, it shows me the following error:

<b>Fatal error</b>:  Uncaught ArgumentCountError: Too few arguments to function 
Controller::SelectCiudadescontroller(), 0 passed in
C:\xampp\htdocs\coffee\views\modulos\form_registro_usuarios.php on line 65 and exactly 
1 expected in C:\xampp\htdocs\coffee\controller\controller.php:76

and this is my function:

public function SelectCiudadescontroller($valor_id_pais){

        $datosController = $valor_id_pais;

        $respuesta = Datos::SelectCiudadesModel($datosController,"ciudad");

        if(count($respuesta["id_ciudad"]) > 0){

            echo 0;

        }

        else{

            echo 1;
        }

    }
    
asked by jorgnv 16.08.2017 в 17:14
source

1 answer

0

The condition of your if is wrong,

  

if (count ($ answer ["id_ciudad"])> 0)

What you should do is something like this:

if(count($respuesta) > 0)

I hope it helped you

    
answered by 16.08.2017 в 19:41