Select result

I want to pass the result of select into an array, I using PDO.
function listar(){
       $query = "SELECT codigo, nombres FROM prueba";
       $BD = new ConexionDB();
       $recordSet = $BD->prepare($query);
       $recordSet->execute();

      // In this part I need help.
      // This part is a old code I need to change this parte.

       $lista = array();
       while($fila=$recordSet->FetchRow()) {
          $lista[] = new PruebaVO($fila['codigo'], $fila['nombres']);
       }...
PHP:
Select result

from PHP http://ift.tt/224tmgL
via IFTTT
Thanks for your comment
Loading...