Please Log in to join the conversation.
No, that'd be a security vulnerability.Is there a way to retrieve credentials of current DB (server, DB name, DB user, DB pw) as a CB substitution?
You don't need those credentials to execute SQL in PHP. Use Joomla or CBs database API for that. See Joomlas documentation regarding Joomlas API.Would be great for auto actions with eg. PHP code to open DB to fire SQL statements.
global $_CB_database;
$query = "SELECT COUNT(*)"
. "\n FROM " . $_CB_database->NameQuote( 'TABLE_HERE' )
. "\n WHERE " . $_CB_database->NameQuote( 'COLUMN_HERE' ) . " = " . $_CB_database->Quote( 'VALUE_HERE' );
$_CB_database->setQuery( $query );
$exists = $_CB_database->loadResult();
Please Log in to join the conversation.
Please Log in to join the conversation.
Please Log in to join the conversation.