The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
||||
|
||||
Inserting SQL in PHP Problem - please help
I'm trying to insert the following code in a hook but I have a syntax error and I can't seem to figure out how to make it work.
Code:
function prepare_output($id = '', $options = array()) { $this->block_data['longbox'] = '$db->query_first("SELECT * FROM " . TABLE_PREFIX . "formresults WHERE userid = '$bbuserinfo[userid]' ")'; } } Parse error: syntax error, unexpected T_VARIABLE in /home/righscom/public_html/addons/projectfanboy/vb/member.php(463) : eval()'d code on line 247 I'm pretty sure it's the usage of the double and single quotes in my query but I don't know how else to call for the information without it. Can anyone help me please? Here is the entire plug in code below: Code:
$blocklist = array_merge($blocklist, array( 'longbox' => array( 'class' => 'Longbox', 'title' => 'Resume', 'hook_location' => 'profile_left_last' ) )); class vB_ProfileBlock_Longbox extends vB_ProfileBlock { var $template_name = 'memberinfo_block_longboxes'; function confirm_empty_wrap() { return false; } function confirm_display() { return ($this->block_data['longbox'] != ''); } function prepare_output($id = '', $options = array()) { $this->block_data['longbox'] = '$db->query_first("SELECT * FROM " . TABLE_PREFIX . "formresults WHERE userid = '$bbuserinfo[userid]' ")'; } } |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|