Yes, the data already exists in lastreads. In addition to a visual check of the table, I also ran the following test query:
Code:
//go through list of forums already loaded into $forumarray previously
While ($edforum = $DB_site->fetch_array($forumarray))
{
$qsforumid = $edforum['forumid'];
$edlastread = $DB_site->query_first("SELECT lr_lastviewed FROM " . TABLE_PREFIX . "lastreads
WHERE lr_member = $bbuserinfo[userid] and lr_forum=$qsforumid");
$viewed = $edlastread['lr_lastviewed'];
echo 'forumid = ' . $qsforumid;
echo ' date = ' . $viewed . '<br>';
}
returns a result like this:
forumid = 1 date = 1090252769
forumid = 2 date = 1090252769
forumid = 3 date = 1090252769
forumid = 4 date = 1090252769
forumid = 5 date = 1090252769
forumid = 6 date = 1090253340
forumid = 7 date = 1090252769
.
.
The values returned are the correct values stored for my userid/forum.
I'm sure it's just my thick head getting in the way of making this work. I'll keep messing around with it and see if I can figure out what I'm doing wrong.