Jump to content

Luan Agusto

Members
  • Content count

    1
  • Joined

  • Last visited

Community Reputation

0 Comum

About Luan Agusto

  1. Luan Agusto

    Retorno SELECT Orientado ao Objeto

    Estou querendo percorrer uma return de Um select, mas quando o return e maior que um, ele retorna uma erro, as variaveis ficam nulas. alguém pode me ajudar ? class Extracao { private $codblo; private $codpro; private $zonsts; private $allsts; private $dplsts; private $nivsts; private $ds1pro; private $pcbpro; private $etapal; private $uvcsto; private $datrec; private $datfvi; private $uvcdes; public function getCodblo(){ return $this->codblo; } public function setCodblo($codblo){ $this->codblo = $codblo; } public function getCodpro(){ return $this->codpro; } public function setCodpro($codpro){ $this->codpro = $codpro; } public function getZonsts(){ return $this->zonsts; } public function setZonsts($zonsts){ $this->zonsts = $zonsts; } public function getAllsts(){ return $this->allsts; } public function setAllsts($allsts){ $this->allsts = $allsts; } public function getDplsts(){ return $this->dplsts; } public function setDplsts($dplsts){ $this->dplsts = $dplsts; } public function getNivsts(){ return $this->nivsts; } public function setNivsts($nivsts){ $this->nivsts = $nivsts; } public function getDs1pro(){ return $this->ds1pro; } public function setDs1pro($ds1pro){ $this->ds1pro = $ds1pro; } public function getPcbpro(){ return $this->pcbpro; } public function setPcbpro($pcbpro){ $this->pcbpro = $pcbpro; } public function getEtapal(){ return $this->etapal; } public function setEtapal($etapal){ $this->Etapal = $etapal; } public function getUvcsto(){ return $this->uvcsto; } public function setUvcsto($uvcsto){ $this->uvcsto = $uvcsto; } public function getDatrec(){ return $this->datrec; } public function setDatrec($datrec){ $this->daterec = $datrec; } public function getDatfvi(){ return $this->datfvi; } public function setDatfvi($datfvi){ $this->datfvi = $datfvi; } public function getUvcdes(){ return $this->uvcdes; } public function setuvcdes($uvcdes){ $this->uvcdes = $uvcdes; } public function setData($data){ $this->setCodblo($data['CODBLO']); $this->setCodpro($data['CODPRO']); $this->setZonsts($data['ZONSTS']); $this->setAllsts($data['ALLSTS']); $this->setDplsts($data['DPLSTS']); $this->setNivsts($data['NIVSTS']); $this->setDs1pro($data['DS1PRO']); $this->setPcbpro($data['PCBPRO']); $this->setEtapal($data['ETAPAL']); $this->setUvcsto($data['UVCSTO']); $this->setDatrec($data['DATREC']); $this->setDatfvi($data['DATFVI']); $this->setuvcdes($data['UVCDES']); } public function getList($codpro){ $list = new Sql(); $results = $list->select("SELECT gests.ZONSTS, gests.ALLSTS, gests.DPLSTS, gests.NIVSTS, gests.CODPRO, gepal.DS1PRO, gepal.PCBPRO, gepal.ETAPAL, gepal.DATREC, gepal.DATFVI, gepal.UVCSTO FROM gests LEFT JOIN gepal ON gests.CODPRO = gepal.CODPRO WHERE gests.CODPRO = :CODPRO", array( ":CODPRO"=>$codpro )); return $results; //var_dump($results); //if(count($results) > 0){ // $this->setData($results); //} } public function __toString(){ return json_encode(array( "CODBLO"=>$this->getCodblo(), "CODPRO"=>$this->getCodpro(), "ZONSTS"=>$this->getZonsts(), "ALLSTS"=>$this->getAllsts(), "DPLSTS"=>$this->getDplsts(), "NIVSTS"=>$this->getNivsts(), "DS1PRO"=>$this->getDs1pro(), "PCBPRO"=>$this->getPcbpro(), "ETAPAL"=>$this->getEtapal(), "UVCSTO"=>$this->getUvcsto(), "DATREC"=>$this->getDatrec(), "DATFVI"=>$this->getDatfvi(), "UVCDES"=>$this->getUvcdes() )); } } ?> // index.php <?php require_once 'config.php'; /* $sql = new Sql(); $results = $sql->select("SELECT *FROM gests"); echo json_encode($results); */ $conn = new Extracao(); $conn->getList("7896290300011"); //echo $conn; ?>
×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.