Not the coding of documents has nothing to do with the language, the language only processes and sends a processed file back to the user, when the connection to the database is something that by default is configured in the database and not in PHP.
The configuration of the database depends entirely on what the developer will want to do, here is an answer on the subject, although the photo is PHP in it is valid for any language that is facing the Web (ie generating pages):
Note that any version of PHP tries to maintain backward compatibility, so the new PHP7 features do not necessarily make older scripts incompatible, unless you are using a function or class that has previously been discontinued.
To explain better, in case mysqli is an API that makes PHP access the mysql database that can be on a separate port or server, its only problem would be if I was using functions that start like this mysql_
, as they were part of the older API that was already marked as obsolete since the PHP 5.5.0 and was only available until 5.6 for the sake of backward compatibility. Now in version 7.0.0+ it has been removed and scripts written using it will no longer work.
Setting up the charset in the bank
Even if you do this (PDO):
$conn = new PDO('mysql:host=HOST;dbname=BANCO;charset=utf-8', 'USUARIO', 'SENHA');
$conn->exec('SET CHARACTER SET utf8');//Define o charset como UTF-8
Or this (mysqli):
$mysqli->set_charset('utf8')
It does not mean that you are setting up PHP, in fact you are sending a statement to the bank for it to return as the results were requested.
In the case of banks a traditional web page and php will be composed of 4 important things:
- HTTP server (apache, Nginx, IIS, etc)
- PHP language that interprets scripts and returns as response
- database
- Scripts
.php
that you wrote:
All 4 have to have the necessary encoding settings:
- HTTP server: can be resolved in httpd.conf or . htaccess, although you do use
header('Content-Type: ...');
PHP itself already solves, that is only necessary to configure for static files (which may actually be optional)
- PHP Language: set the
header('Content-Type: ...');
- Database: must use the instruction
SET CHARACTER SET ...
or $mysqli->set_charset('...')
to say what you expect
- Scripts
.php
that you wrote: must be saved with the desired encoding, if it is UTF-8 use "UTF-8 without GOOD", if it is latin1 or similar save the scripts as ANSI or windows-1252 or iso-8859-1 or compatible.
You deleted the other and recreated the same, that’s not a good use of the site. If a question takes negative, the right is to try to follow the guidelines in [Ask] and improve it by editing, not recreating the question
– user28595
Your question doesn’t make much sense. I see no relation between the language version and the database encoding, the fact of migrating does not mean that it results in a problem, as long as they are under the same encoding.
– user28595
now yes, you gave me a plausible explanation
– user60252