Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Aew galera podem me dar uma ajuda esta retornando o seguinte erro:
Fatal error: Using $this when not in object context in C:\xampp\htdocs\guia3\usuarios\estabelecimento\modules\generalModule.php on line 14
O codigo:
<?php
Class Data{
private $doc;
private $tDoc;
function __construct(){
$this->doc = $_SESSION['doc'];
$this->tDoc = $_SESSION['tDoc'];
}
static function getDados($table){
$SQL = "SELECT * FROM `".$table."` WHERE `".$this->tDoc."`='".$this->doc."'";
$q = mysql_query($SQL);
$t = mysql_fetch_assoc($q);
return $t;
}
function getMatrix($table){
$SQL = "SELECT * FROM `".$table."` WHERE `".$this->tDoc."`='".$this->doc."'";
$q = mysql_query($SQL);
return $q;
}
function updateField($table,$fieldName,$newValue){
$SQL = "UPDATE `".$table."` SET `".$fieldName."`='".$newValue."' WHERE `".$this->tDoc."`='".$this->doc."'";
$q = mysql_query($SQL);
if($q){
return true;
} else {
return false;
}
}
function causeError($pageReturn){
$line = '<meta http-equiv="refresh" content="'.$pageReturn.'">';
echo '<script language="JavaScript">alert("Ocorreu um erro durante a alteração!");</script>';
echo $line;
}
function causeSuccess($pageReturn){
$line = '<meta http-equiv="refresh" content="'.$pageReturn.'">';
echo '<script language="JavaScript">alert("Alterado com sucesso!");</script>';
echo $line;
}
}
?>Carregando comentários...