我正在使用以下代码
require 'Smarty/libs/Smarty.class.php';
$smarty = new Smarty;
$sel=mysql_query("select id, name from form");
$smarty->assign('contact', $db->getRow($sql));
$smarty->display('testfunction.tpl');
我收到错误:
Fatal error: Call to a member function getRow() on a non-object in D:\xampp\htdocs\smarty\testfun.php on line 21
最佳答案
您尚未声明任何 $db 对象。 改用这个:
$smarty->assign('contact', mysql_fetch_row($sel));
关于php - 聪明的 fatal error ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11920865/