I have searched forms & found a couple of threads relating to this error. These problems seem to relate to not checking the DB result or case sensitivity which doesn't appear to be the case here.
It works fine if rows are returned but displays error if none found:
Fatal error: Call to undefined function: fetchrow()
Code is:
$dsn = $DB_dbType . "://" // Build a DSN string (Data Source Name)
. $DB_user . ":" // Required by DB::connect()
. $DB_pass . "@"
. $DB_host . "/"
. $DB_dbName;
$db = DB::connect($dsn, TRUE);
if (DB::isError($db)) {
die($db->getMessage());
}
$sql = "SELECT *
FROM fw_page p, fw_template_region tr, fw_article a, fw_region r
WHERE p.template_id = tr.template_id and
tr.region_id = a.region_id and
tr.region_id = r.region_id and
p.page_id = a.page_id and
a.live = 'Yes' and
p.page_id = " . $page_id .
" ORDER BY tr.sequence"; // Build your SQL query
$resArticles = $db->query($sql);
if (DB::isError($db)) { // Check whether the object is a connection or error
die($db->getMessage());
}
if ($resArticles) { // I need to know what to put here if no rows returned *
$artRowNum = 0;
$savedName = "";
while ($row = $resArticles->fetchRow(DB_FETCHMODE_ASSOC)) {
....