我基本上没有使用 PHP 的经验,但我在设置 Cron Job 更新任务时遇到了问题。它返回一个错误:
Fatal error: Class 'DB' not found in /home/content/96/9092196/html/updateevents2.php on line 17
而且我不确定如何解决它。我没有编写代码,也无法联系编写代码的人,但我相信无论如何它写得不好。
<?php
ini_set("include_path", ini_get("include_path") . "/usr/share/pear:/usr/local/lib/php:/usr/local/php5/lib/php/PEAR/");
//include("includes/page_start.php");
//---------------------------------------------NewFile
$dsn = array(
'phptype' => "mysql",
'hostspec' => "111.11.111.111",
'database' => "database",
'username' => "username",
'password' => "password"
);
$db = DB::connect($dsn);
if (PEAR::isError($db))
echo "error connecting to db";
任何帮助将不胜感激谢谢