⇧
vadnica-logo
My Services About the Project Telegram O meni O meni

Creating a Table (CREATE TABLE)

Once the database is created, we need tables within it. Using the exec() method, we send an SQL command to define columns, their data types (e.g., INT, VARCHAR), and set the primary key (ID).

EXAMPLE
RESULT
The result will be displayed here...

In the example above, we created an users table. Note that in the DSN string, we now specify the database name (dbname=pdo_database), as we want to connect directly to it.