Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/05/2015, 09:25
Avatar de bandolera
bandolera
 
Fecha de Ingreso: abril-2009
Mensajes: 613
Antigüedad: 15 años
Puntos: 7
Pregunta Undefined variable Y could not be converted to string

Tengo este código:

ESTE ES EL DAO: Se toman dos campos se suman y se asignan al VO para luego ser visualizados.
==========

Código PHP:
function totales($codstud){
$query "SELECT SUM(cargo) cargo, SUM(abono) abono
                FROM  sc_ctacte 
                WHERE cod_stud ="
.$codstud;
$BD = new ConexionDB();
$recordSet $BD->dbLink->Execute($query);
if (!
$recordSet){
   
Debug::println("No se pudo ejecutar la consulta TOTALES : " $query);
   return 
false;
}
$totstud = new TotalesStudVO($fila['cargo'], $fila['abono']);  <=== LINEA 46
return $totstud;

Y ESTE ES EL VO:
==========
Código PHP:
class TotalesStudVO {

    public 
$totcargo;
    public 
$totabono;
    
    public function 
__construct($totc$tota){
       
$this->totcargo $totc;
       
$this->totabono $tota;
    }

    function 
__destruct(){
    } 
Y mi plantilla de salida trato de visualizar con estas líneas
Código PHP:
<td>{$TotalesStudVO->cargo}</td>
<
td>{$TotalesStudVO->abono}</td
Pero me sale que :
Código HTML:
Notice: Undefined variable: fila in DAO.class.php on line 46
Código HTML:
Catchable fatal error: Object of class TotalesStudVO could not be converted to string in CtacteDAO.class.php on line 48
La tabla tiene la siguiente estructura:
Código PHP:
CREATE TABLE IF NOT EXISTS `sc_ctacte` (
  `
id_ctacteint(11NOT NULL,
  `
cod_studint(4NOT NULL,
  `
fec_mov_ctadate NOT NULL,
  `
referenciavarchar(45NOT NULL,
  `
id_transaccionint(2NOT NULL,
  `
doc_sustentovarchar(30) DEFAULT NULL,
  `
id_pagoint(1) DEFAULT NULL,
  `
cant_ejemplaresint(4) DEFAULT NULL,
  `
cargodecimal(8,2) DEFAULT NULL,
  `
abonodecimal(8,2) DEFAULT NULL
El VO solo toma la sumatoria de los dos cambios indicados CARGO y ABONO.

Alguna idea???
__________________
Todos somos iguales. NO! a la violencia de género.