I'm trying to display the database query, but when I try to display it, the Object of class TDataTable could not be converted to string.
error appears and pointing the error to the file frm_noticia.php
... What should I do to fix this error?
Obs:. Ordem de Processo (controller_noticia > view_noticia > frm_noticia)
controller_noticia.php
function obterIdLink() {
$sql = "SELECT MAX(noticia_id) FROM noticia";
$result = $this->getConexao()->executeQuery($sql);
if($result != null) {
return $result;
} else {
return null;
}
}
view_noticia.php
function obterIdLink() {
return $this->getController()->obterIdLink();
}
frm_noticia.php
echo $view->obterIdLink();
TDataTable.php
class TDataTable {
private $FRows = array();
function __construct ( $resource ) {
switch(DB_TYPE){
case "MYSQL":
while ($row = mysql_fetch_assoc($resource)) {
$this->FRows[] = new TDataRow($row);
}
break;
}
}
function Rows() {
return $this->FRows;
}
function RowCount() {
return count($this->FRows);
}
function bind($object, $line) {
throw new Exception("Nao implementado");
}
function getRow($pos) {
return $this->FRows[$pos];
}
}