PDA

View Full Version : Which is best - $vbulletin->db->query_read OR $db->query_read


Mr Happy
04-09-2010, 03:39 PM
Just a very quick question.

I'm wondering what's the difference between

$vbulletin->db->query_read(Select bla bla bla .....

and

$db->query_read(Select bla bla bla .....

Trying to write my first mod for vBulletin 4.x (wish me luck I'll need it :P ) and wondering which is the best to use.

I've being using lots of the tutorials and other posts as references but I'm not sure which is best practice. Both seam to work fine.

Paul M
04-09-2010, 04:09 PM
You should always use $vbulletin->db->xxxxxx - the other method is obsolete and only still around for backwards compatibility.

Mr Happy
04-09-2010, 07:17 PM
Excellent, thanks for that Paul M and for the fast reply.



This can be closed if you want as it's answered :D

Jaxel
04-09-2010, 10:52 PM
I always use $vbulletin->db simply because putting "global $vbulletin" into a function covers everything, while "global $db" only covers database queries.