The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
How to get username from vbb db?
I have the proper db connect stuff all lined up, but the db refuses to spit data back at me. On my front page i have a login form and it auths against the vbb user info by way of a hack found here - works great. Then when the user visits after having the login cookie set, I want to print 'Welcome back $username' where the form would be. 'Welcome back ' shows but not the username i'm shooting for. That all works great, but for the life of me (and maybe i'm missing something simple) but I cant seem to pull data from the 'user' table of my vbb dbase. My query is $result=mysql_query("SELECT 'username' FROM 'user' WHERE userid='$bbuserid'"); The variable $bbuserid is set at the top of the php when it checks the cookies, so that works (and with myself logged-in, results with '2', my correct userid). How can I pull this user data from the database, or is there an easier way? I have a very customized login form that integrates with the site design so I'd rather not have to settle for the default vbb login.
|
#2
|
|||
|
|||
PHP Code:
|
#3
|
|||
|
|||
ahh thanks, my eyesight is going, only difference i can see is that i used " -> $username = $user["username"];
kept telling me mysql_fetch_array wasnt a supported call |
#4
|
||||
|
||||
Hey filb, how come you have to use mysql_fetch_array? Shouldn't it only return one entry anyways?
|
#5
|
|||
|
|||
mysql_query() always returns a handle. vB's wrapper class simplifies things with query_first() which:
1. Gets the result handle 2. Calls mysql_fetch_array 3. Returns the first row |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|