<?php /* my function class */
class dbFunctions{
public $dbHost = "localhost",
$dbLogin = "root",
$dbPwd = "",
$dbName = "forex",
$mysqli;
/* Create a new mysqli object with database connection parameters */
public function __construct(){
$this->mysqli = new mysqli($this->dbHost, $this->dbLogin, $this->dbPwd , $this->dbName);
if(mysqli_connect_errno()) {
echo "Connection Failed: " . mysqli_connect_errno();
exit();
}
}
public function address(){
if($stmt = $this->mysqli -> prepare("SELECT `email_content` FROM `content` WHERE `content_name`= ? ")) {
$content = 'address';
$stmt -> bind_param("s", $content);
$stmt -> execute();
$stmt -> bind_result($result);
$stmt -> fetch();
$stmt -> close();
echo $result;
}
}
}
$obj = new dbFunctions() ;
?>
<!-- MY FOOTER FILE WHERE I CALLED THE FUNCTION-->
<div id="address">
<a href="#" style="color:#fff; text-decoration:none;"> Contact Us:</a>
<?php if(!empty($obj->address())){?><?php $obj->address();?>
<?php }?>
</div>
致命错误:无法在第 3 行的 C:\wamp\www\forex\includes\footer.html 的写入上下文中使用方法返回值
请帮我解决这个问题..我搜索了很多,但没有找到任何解决方案。