PDA

View Full Version : Accessing vBulletin's thread table directly


EEssam
12-06-2007, 01:52 AM
Hi,

I'm coding a script that is accessing vBulletin's thread table directly... I'm wondering what my MySQL WHERE Clause should include to exclude any post that is deleted/on pending list/or any other thing that I may be not aware of? e.g. not publicly displayed.

For now, my SQL statement looks like this:

SELECT * FROM thread WHERE visible = 1 AND forumid NOT IN(excluded forum ids)

Anything missing?

Your help Would be greatly appreciated.
Reply With Quote

Mythotical
12-06-2007, 01:54 AM
you need to make sure you have forumid='id of your forum so you need to have forumid='$_GET['id']'

Opserty
12-06-2007, 02:40 PM
you need to make sure you have forumid='id of your forum so you need to have forumid='$_GET['id']'
He's not selecting threads for a certain forum, he is getting threads from all forums except the excluded ones.

The query looks fine although you may want to think about adding a LIMIT clause to limit the number of results returned, depending on what you are doing with the data.

Mythotical
12-06-2007, 05:37 PM
LOL, my bad, I misunderstood.