Hi all,
I have create a custom function where I want to update records directly in the database, so without using the workflow 'Update fields'-option.
But, how do I fetch the connection details?
$con = mysqli_connect();
$sql = "UPDATE vtiger_contactdetails SET email= '[email protected]' WHERE contactid = '116'";
return mysqli_query($con,$sql);
$db = \App\Db::getInstance();
$db->createCommand('DROP TABLE IF EXISTS `a_vgdn`;')->execute();
@mariuszkrzaczkowski Is there any english version of this documentation ?
@LaurensCleyman
it is yii2
documention could be find here:
https://www.yiiframework.com/doc/api/2.0/yii-db-activequery
also the link above have some examples.
In addition your query is directly editing the db, however you can edit any record data with RecordModel you can search git for examples.
example:
$recordModel->set('email',$email);
$recordModel->save;
@apcloic You can find the English version here: https://yetiforce.com/en/knowledge-base/documentation/developer-documentation/item/new-db-communication-engine
Most helpful comment
@LaurensCleyman
it is yii2
documention could be find here:
https://www.yiiframework.com/doc/api/2.0/yii-db-activequery
also the link above have some examples.
In addition your query is directly editing the db, however you can edit any record data with RecordModel you can search git for examples.
example:
$recordModel->set('email',$email);
$recordModel->save;