Ajax funcion Load on YIi 2

Hi my friends!!

Can you help me whit Yii 2, please?

I need load a listbox whit load function ajax. The parameters has sent correctly, but no load functions as $connection=Yii::$app->db; and

$command=createCommand($SQL);

The ajax file is:




$(document).ready(function() {

		$("#idpadre").change(function(event)

		{

			var idpadre = $(this).find(':selected').val();

			$("#pidhijo").load('/basic/views/combobox.php?buscar=hijos&idpadre='+idpadre);

		});

});



My code php is:




<?php   

        use yii\helpers\Html;

	use yii\widgets\ActiveForm;

	use yii\helpers\Url; 

?>


<?php

if ($_GET['buscar']=="hijos")

{

$a=mysql_real_escape_string(intval($_GET['idpadre']));

$SQL=(unidades($a));


echo $SQL; //only for make a test (work!)




$connection=Yii::$app->db; //(not work)

$command=createCommand($SQL);

$dataReader=$command->query(); 

echo "<label>Unidad a:</label><select class='select' name='idhijo' id='idhijo'>";

echo "<option value=''>Seleccione marca ...</option>";

foreach($dataReader as $row) 

    { 

		echo "<option value='".$row["id_unidad_estrategica"]."'";

		if ($row["id_unidad_estrategica"]==$valoractual) echo 'selected';

		echo ">".utf8_encode($row["unidad"])."</option>\r\n";

	}


	echo "</select>";    


}

?>



which is my problem ?, appreciate your help.

Cheers

The function unidades() has defined in other file, and work correctly, then the query is ok!.

The problem is in the connection and query execution, shows nothing