In the making of this course about PHP with databases access, we have chosen MySQL database because it is free and also because it is the most widely used in UNIX environment. To this end, the server where the pages are hosted must provide us with tools to create the database or have access to Telnet.
The command to create a MySQL database is the following:
Con este comando conseguimos crear la una base de datos en el servidor de bases de datos de nuestro servidor.
Once we achieve this, we will create the database tables; the description of the tables includes the structure of the information to be stored in them. In order to do this, we will use the consulting language SQL, common to all related databases.
In this example, we have created a table called test with 3 fields: one identifier field that will be used to particularly identify one row with the value of said field, another field with the name of a person and the last field with the last name of said person.
To create the table you can use your web server's MySQL administration tool or you can write a text file with the content of the equivalent SQL and then indicate the database engine to execute it with the following instruction: