It's a traditional MySQL function.
or the MYSQLI function.
Or the method of the PDO interface.
What are the characteristics and applicability of these three methods?
In addition: I want to ask one thing:
Setting the character set, strictly speaking, whether the character set name should be quoted, I think the character set name is a string constant, causing the better, such as the speed of execution.
mysql_query ("Set names ' gb2312 '");
Reply to discussion (solution)
It should be enclosed in quotation marks, but nothing else is known, and that's what the book says.
What kind of calculation?
Most of the time, PDO can easily replace various databases such as MSSQL
If it's a small system, then consider using mysqli
Of course, MySQL is also in use ...
MySQL < mysqli < PDO
I'll take a look at
How to get points, who knows?
The new version of PHP defaults to the PDO as a connection method for MySQL, so it is clear that PDO is more and more popular.
Choose PDO and Mysqli first, because MySQL functions are very risky and vulnerable to SQL injection attacks because they belong to the early PHP product. Mysqli and PDO are more secure by using placeholder preprocessing.
Small web site generally, that's convenient.