The issue of information storage has changed with the advent of databases, with the advent of cloud ideas it has changed, but ultimately the developer has at his disposal a fully functional database and stores information as it seems to him right, or as required by the project.
MySQL has a well-deserved reputation. This is a simple, effective and reliable information management system using the traditional SQL language. In the right hands, MySQL is a relational idea of storing and processing information in the widest possible range of services that have historically developed. They reflect practicality and represent the functionality of a modern database.
MySQL ranking and place
Databases - a popular set of tools for the presentation, storage and processing of information. However, there have always been many options for implementing such tools, that is, models and logic of relational relationships between data.
MySQL is not the only option for efficiently presenting and using data, but in the last few years, MySQL is the most commonly used tool.
If we talk about the use of site management systems, which recently are very popular among programmers, then most of them are based on the use of MySQL. Often, choosing another base is simply impossible.
If we are talking about the manual development of a web resource, then it is easier and more reliable to find the MySQL version, although in this (manual) context you can always select any database.
In most cases, an objective regularity leads the developer to PHP / MySQL. This pair has become de facto the best in programming sites and other resources for local and distributed information processing networks.
Database connection
There is nothing easier than joining a database.
Here on the localhost "localhost" is the base "sci_exchange_base" to which the user "sci_iN_WMiX" is connected with the password "POi17DO". After a successful connection, the database becomes available for work or is created “by the new” function scCreateTables ().
Such logic, “if there is nothing or there is a problem: create everything again in its original form” makes any code of any resource safe. There is nothing easier than creating it again, and not sorting out the rubble of the problems created by numerous visitors to the resource, errors of communication lines and technical means:
- connecting to MySQL is easy;
- working with tables and data is simple;
- there is nothing simpler than providing a log of any action of any visitor;
- create a distributed flow of information processing processes that will adequately and safely ensure the safety of all relevant data.
Database usage
Almost any data operation in PHP / MySQL is a query. The result of the query is data or a change to the contents of the database. MySQL itself is a tool that uses its functionality to execute its functionality.
In other words, database management, users, and other administrative capabilities lie and are available within its tables and MySQL queries.
In the vast majority of cases, developers adhere to the established experience of using databases in general. In particular, the standard construction of the MySQL query is taken as the basis, then the result is analyzed in PHP in the code.
In this example, (1) is the formation of the query string, (2) is the execution of the request. This is a common database application, described in the MySQL manual, which has been established in practice.
Here, three parameters are passed to the input of the function:
- list of table fields;
- table name
- sampling conditions.
As a result of the MySQL query, a selection is made of the data that is written to the data string and returned as the result of the function.
Independent use of MySQL
The iLineSel () function is a method of the database access object. It doesn’t fundamentally use objects to access information, but it’s important to divide the functionality into one that is dependent on the database itself, and one that is dependent on the resource code.
In the vast majority of cases, MySQL has four main procedures:
- insert;
- removal;
- change;
- sample.
By presenting these four actions with four functions, you can "ignore" the formation of query queries in the form of a MySQL string.
The functions iLineSel (), iLineIns (), iLineDel (), iLineUpd () are used in the code and require specifying table names, field names, conditions and values. This is convenient for the resource code. Inside functions, query strings and constructs are used to access the database.
Compatibility and Efficiency
With this approach, the developer gets the opportunity to use in his work a set of specific database functions in his own view. This simplifies his work with other developers, makes his code more readable and eliminates problems in cases where the syntax or logic of using PHP or MySQL changes, and the latter is often very important.
Incompatibility of versions - for modern tools - is the norm of things, and it is characteristic that, unlike in the past, when the requirement of compatibility was natural, the aspect of functionality and efficiency has now become important, and compatibility has faded into the background.
Functional dynamics
The experience of using databases is so great that many conceptual things have become too familiar. But an example of how the concept of compatibility objectively and naturally faded into the background allows us to note that not all database tables are “rectangular” and absolutely not all relationships in a database are “relational”.
By and large, the appearance in the databases of fields of variable length in itself reports that not everything fits into the usual framework. Not every table has headers, not all rows are required to have all the fields provided by the table structure. And the table may have data that determines its structure, but not vice versa.
The latter seems increasingly normal and natural. The widely used object-oriented programming in the context of databases, especially in the PHP / MySQL bundle, allows you to create systems of objects that write themselves to the database. But since these objects are not always always the same as they were at the time of creation, database tables can dynamically change when dynamic objects are stored.
In the simplest case, a modern table is a row or a row system, the length does not matter here, it can be emulated at the database table level. But the use of objects allows you to emulate the necessary properties of the data and abstract from the rigid structure, relational ideas, tables and the usual strict syntax for working with data.