The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
userid in query
I'm writing a plugin that has a query inside that "filters" the entries from a database field if the userid in the db field matches the user's id (it's a postbit modification). In the query I currently have it as $post[userid]. Should I use something else? I also tried $post['userid'] and even $post["userid"] (lol) but neither worked...
The error I get is Fatal error: Call to a member function on a non-object. |
#2
|
|||
|
|||
Ok, postbit wouldnt be $post['whatever'], it would be something like this
Code:
$this->post['userid'] |
#3
|
|||
|
|||
Already tried this and it doesn't work...
Here's the query: [sql] SELECT COUNT(*) AS count FROM " . TABLE_PREFIX . "thread WHERE postuserid = '$this->post['userid']' [/sql] I can tell it has to do with the quotes but what can I do with them? |
#4
|
|||
|
|||
Ok, in what im showing you, itll just be PHP Code for a variable called SQL, I know why your code is not working (I think...)
PHP Code:
EDIT: Fixed small error that causes big problems |
#5
|
|||
|
|||
Still the same error.
This is the whole code of the plugin so far: PHP Code:
|
#6
|
||||
|
||||
Try $vbulletin->db instead of $db.
|
#7
|
|||
|
|||
That can't be the problem, I used the same syntax in another plugin that works correctly.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|