Forums
- 
		
- Forum
 - Posts
 
 - 
		
			
		
			
- Installation
 - 28,536
 
- Troubleshooting
 - 62,801
 
- Themes
 - 10,444
 
- Plugins
 - 15,389
 
- Requests & Feedback
 - 14,986
 
- Showcase
 - 3,258
 
 - 
		
 
Fixed it myself. It was the: FROM $bbdb->portal" that didn’t work. Changed it into FROM ".$bb_table_prefix."portal" and added $bb_table_prefix; in the global as well and all seems to work fine now.
Working code:
$pforum_id = $bbdb->get_var("SELECT pforum_id FROM ".$bb_table_prefix."portal");
Thx for the suggestions given
Null