PHP·98 questions

How to connect to MySQL?

Answer
PDO: new PDO('mysql:host=localhost;dbname=test', 'user', 'pass').
MySQLi: new mysqli().
PDO is preferable.
Charset: charset=utf8mb4.
try/catch for errors.
Was this answer helpful?

More questions in this topic

Related questions from other topics