Quote:
Originally Posted by rin
Yup, I have just tried around a little bit and found out that cached attachments are shown in either case.
May I ask for help on this one:
Code:
$query = $db->query_read("SELECT current_bandwidth FROM " . TABLE_PREFIX . "user WHERE userid = " . $vbulletin->userinfo[userid]);
$add = $query[current_bandwidth] + 550;
Either the mySQL query is corrupt or the value of $query[current_bandwidth] is 0. Which it should not be since it has some value in the database. My guess would be that I can not call the value via the method I used. But after searching around, also in vBulletin code I didn't find a suitable solution.
|
Reading from the database is a two-stage process, unless you are sure that there is only a single record to fetch. You either use the following sequence:
Code:
$asb = $vbulletin->db->query_read("
SELECT current_bandwidth FROM " . TABLE_PREFIX . "user
WHERE userid = " . $vbulletin->userinfo[userid]);
while ($query = $vbulletin->db->fetch_array($asb)) {
// process record
}
or, if you arre certain there is one record only, the following:
Code:
$query = $vbulletin->db->query_first("
SELECT current_bandwidth FROM " . TABLE_PREFIX . "user
WHERE userid = " . $vbulletin->userinfo[userid]);