![]() |
getting info from a db table?
How would I go about getting infomation like the way you can with $bbuserinfo. But with another table?
|
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"); |
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 |
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.
|
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. ;)
|
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 |
Thanks Reeve, but I figured it out after sobering up :)
|
PHP Code:
|
Quote:
Code:
$userinfo = $DB_site->query_first("SELECT * FROM user WHERE userid=1"); |
All times are GMT. The time now is 07:33 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|