gpt4 book ai didi

php - 聪明的 fatal error

转载 作者:行者123 更新时间:2023-11-29 14:19:53 25 4
gpt4 key购买 nike

我正在使用以下代码

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com