I'm a mysql beginner myself. But if you look in includes/config.php, you should find something like this:
Code:
// ****** TABLE PREFIX ******
// Prefix that your vBulletin tables have in the database.
$config['Database']['tableprefix'] = 'XXX';
and if you have something between the quotes at the end of that line (in place of XXX), then you'd have to add that to the beginning of the table name in your query (like myforum_vb.
XXXtable). But it's possible that you don't have anything where XXX is in which case, never mind. (And of course you don't want to change what it says in config.php).
You could also try leaving out 'myforum_vb.' although I guess if that's the actual name of the database it should work that way. (ETA: the database name is defined just above that table prefix in config.php, in case there's any doubt).