The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Need a quick query
I am looking to set a variable ($memhealth) from data in the database. Something like this
Quote:
the above when put into a template as $memhealth only returns the word "Array" I need it to be the value stored in the database. Any help appreciated. |
#2
|
||||
|
||||
For any query looking for the user looking at the page, use this:
WHERE userid=$bbuserinfo[userid] |
#3
|
|||
|
|||
Thanks Erwin. That was easy. Now the next question. How do I re-do this query
Quote:
I have little or new clue when it comes to quering a database but I am trying to learn. |
#4
|
||||
|
||||
Where are you using this query? Which PHP file?
You might as well join that query with an existing query in that file, so you save yourself 1 extra query, since there are many queries searching the user table in certain files that you can just add this to. |
#5
|
||||
|
||||
$memhealth[battle_health] is the variable the data is contained in.
|
#6
|
|||
|
|||
This is a new php file. I am working on a hack and am stuck on this query.
|
#7
|
||||
|
||||
Okay, try this.
Make sure at the very top of the PHP file it says this: PHP Code:
Then try this query: PHP Code:
|
#8
|
|||
|
|||
Yea! Erwin it worked. Thanks guys.
|
#9
|
||||
|
||||
Glad it worked!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|