PDA

View Full Version : Sql to get the unread thread count for a user


yi_huangyi
06-09-2009, 09:06 AM
Hi,

We are trying to integrate the vBulletin with our website and we need to show the unread thread numbers of a user in vBulletin. We tried to use below sql to get the unread number:

select count(*) from thread where lastpost>(select lastvisit from user where username='admin')

But the return value isn't proper sometime and the vBulletin can know which thread is unread, how to get the unread thread of a user throught sql query?

Thanks
Alex