Jump to content

Concatenate in query


wegorz23

Recommended Posts

Hello, how can I use concatenate in query SELECT ? 

I have this query : $row = \IPS\Db::i()->select('*', 'cms_custom_database_' . \IPS\Settings::i()->site_ccd, array('member_id=?', \IPS\Member::loggedIn()->member_id));

But this doesnt work .

 

Edit: How can I access variables in a file conf_global.php ? Because \IPS\Settings::i()->site_ccd return null, so this doesnt work

Link to comment
Share on other sites

Please take a look at the \IPS\Settings file:) You can't just use custom settings in the conf_global.php, you'll need to whitelist them via a hook

	public function getAllowedFields()
	{
		return array( 'sql_host', 'sql_database', 'sql_user', 'sql_pass', 'sql_port', 'sql_socket', 'sql_tbl_prefix', 'sql_utf8mb4', 'board_start', 'installed', 'base_url', 'guest_group', 'member_group', 'admin_group' );
	}

 

Link to comment
Share on other sites

Generally speaking, you shouldn't be adding settings to conf_global.php. You should add them via the developer center to a plugin or application (then you don't need to edit conf_global.php)

If that's not an option, you still need a plugin on \IPS\Settings to add your new setting to the getAllowedFields() method Daniel highlighted.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...