×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: PHP
Posted by: Pascual Muñoz
Added: Nov 19, 2016 4:24 PM
Views: 11
HowTo Ejecutar SQL directa en Symfony.
  1. //https://stackoverflow.com/questions/11689226/deleting-table-using-doctrine2-and-symfony2/19955878#19955878
  2. $em = $this->getDoctrine()->getManager();
  3. $sql = 'DROP TABLE hereYourTableName;';
  4. $connection = $em->getConnection();
  5. $stmt = $connection->prepare($sql);
  6. $stmt->execute();
  7. $stmt->closeCursor();