The Arcive of vBulletin Modifications Site. |
|
getting info from a db table? Details »»
|
|||||||||||||||||||||||||
How would I go about getting infomation like the way you can with $bbuserinfo. But with another table?
Show Your Support
|
|||||||||||||||||||||||||
| Comments |
|
#2
|
||||
|
||||
|
Well the way I do it is go into PHPMyAdmin and look at the different tables and see which one has the info you want the do
$variable=$DB_site->query_first("SELECT * FROM INSERTTABLEHERE"); |
|
#3
|
||||
|
||||
|
Ummmm... I know how to do that what I want to be able to do is call information like the $bbuserinfo does.
examples: $bbuserinfo[username] $bbuserinfo[userid] and so no but with a different table |
|
#4
|
|||
|
|||
|
well the bbuserinfo query is in session.php, i don't really understand what you are trying to do...if you want to grab extra info to $bbuserinfo from another table then just add ,tablename.* to the query....but if you want to grab a totaly diffrent table that isn't based on userid then you prolly would be better off making a function.
|
|
#5
|
||||
|
||||
|
Umm.. there are ways of doing it without having to make another function... I guess I will have to get off my lazy ass site down and do it.
|
|
#6
|
||||
|
||||
|
If you have a variable pulling multiple information from a table, then you can use the variable name with the field name in brackets to have it displayed.
ex: $myvar query_first("field1, field2, field3"); $myvar[field1] $myvar[field2] $myvar[field3] Or something like that,... I think you catch on to my horribly bad explaination here =P |
|
#7
|
||||
|
||||
|
Thanks Reeve, but I figured it out after sobering up
|
|
#8
|
||||
|
||||
|
PHP Code:
|
|
#9
|
||||
|
||||
|
Quote:
Code:
$userinfo = $DB_site->query_first("SELECT * FROM user WHERE userid=1");
|
![]() |
|
|