I have an old vBulletin product I am upgrading and while playing around with it, I managed to get it functioning a couple of ways.
The original outdated code:
$tests = mysql_query("SELECT count(*) FROM `" . TABLE_PREFIX . "something`");
$test = (mysql_result($tests, 0, 0));
The way I'm used to updating these types of products:
$tests = $vbulletin->db->query_read("SELECT count(*) FROM `" . TABLE_PREFIX . "something`");
$test = $vbulletin->db->num_rows($tests);
I found this sample code though and was also able to get my product working using this line instead:
$test = array_pop($db->query_first("SELECT count(*) FROM `" . TABLE_PREFIX . "something`", DBARRAY_NUM)) ;
Which leads me to my question:
Aside from being less characters of code, is there any benefit to using an array_pop in this manner?