I am trying to make a back-up from a table with the bellow code (command line action) but I have the error can not create/write to file and the \Yii::$app->basePath is not well formated: cxampphttdocsfront and not c:/xampp/httdocs/front at the command line error how can I find the "web: folder at console apps?
public function actionOut() {
$tableName = 'medication';
$backupFile = \Yii::$app->basePath.'/patients/yourtable.sql';
$query = "SELECT * INTO OUTFILE '$backupFile' FROM $tableName";
Yii::$app->db->createCommand($query)
->execute();
}
}