Unable to create tables dynamically using doctrine,I got queries for insert,update but i am not able to create table in database,I tried to find but it is showing table created using command line,I want to create using php script and dynamically
HERE IS MY CODE
<?php
//bootstrap.php
// I am able to fetch ,insert ,delete records from existing tables and wanted to
//know if there is any way i can create table using php script
// i am aware that we can create table using CMD but willing to create using only php scripts i.e Dynamically
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Connection;
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\Common\Annotations\AnnotationRegistry;
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/entities/Users.php';
$paths = array(__DIR__ . '/entities');
$isDevMode = false;
$connectionParams = array(
'driver' => 'pdo_mysql',
'user' => 'root',
'host' => 'localhost',
'password' => '',
'dbname' => 'doctrine',
);
$config = Setup::createConfiguration($isDevMode);
$driver = new AnnotationDriver(new AnnotationReader(), $paths);
// registering noop annotation autoloader - allow all annotations by default
AnnotationRegistry::registerLoader('class_exists');
$config->setMetadataDriverImpl($driver);
$em = EntityManager::create($connectionParams, $config);
$query = $em->createQuery('SELECT u.email, u.password FROM users u');
$users = $query->getResult(); // array of CmsUser username and name values
echo $users[0]['email'];