close ad
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

loop thru MySQL recordset to get unread count

Thread began 5/31/2021 12:00 pm by Mr Wizard | Last modified 6/01/2021 10:58 am by Mr Wizard | 235 views | 1 replies

Mr Wizard

loop thru MySQL recordset to get unread count

So, just trying to get a simple function running. I have 2 tables in my mariaDB, 1 for journal entries, and 1 for journal entry has been read entry. Just trying to loop thru all the records in my journal entries, and if there is an entry in the read section for it, it adds 1 to the variable and loops thru to get the total amount of Unread notifications ( meaning there's not any entry for that user in the journal_read table that shows the read the entry ) and then return the number so I can echo it on my top bar where I want it.

$jid = journal entry ID
$pid = user ID grabbed from the session
link.php is my maria credentials

I'm using the Webassist MySQLi deal for my dreamweaver, and of course, it does not have this option built in.

function UnreadJournalCount() {

require($_SERVER['DOCUMENT_ROOT'] . 'link.php');

$NotificationsListTotalNew = new WA_MySQLi_RS("NotificationsListTotalNew",$link,0);
$NotificationsListTotalNew->setQuery("SELECT * FROM journal");

foreach ($NotificationsListTotalNew as $row):

if(CheckJournalRead($row["jid"],$_SESSION['pid']) == "true"){ $UnreadCount = $UnreadCount + 1; }


return $UnreadCount;

However, when I change $row["jid"] to $NotificationsListTotalNew->getColumnVal("jid") to more error, but it skips the first row, and I only get 16 rows. Any help would be lovely.

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...