I once again here. Let's go.
Well, my problem is this:
I am passing values to my method in php via ajax, but they are not returning anything to me, I did some testing and it is working on the next line
I'm going to post the test code (where it returns me) and what I want, however, is catching
PHP method
public function listarCidade($id)
{
$obj_cidade = $this->verTodos("est_id=$id");
if( $obj_cidade )
{
$opt="";
foreach ($obj_cidade as $key)
$opt .= "<option value='{$key->id}'>{$key->cid_nome}</option>";
echo json_encode($opt);
}
}
In this line:
$opt .= "<option value='{$key->id}'>{$key->cid_nome}</option>";
-O problema está sendo apenas isso ( '$key->cid_nome' )
Because if I remove this little code it gives me the return but with nothing written in
<option></option>
What to do in galera?