mirror of
https://github.com/codeguy/php-the-right-way.git
synced 2025-08-14 09:44:00 +02:00
Use utf8mb4 instead of utf8 in MySQL database connection string
This commit is contained in:
@@ -48,7 +48,7 @@ logic in and you have a "View", which is very nearly [MVC] - a common OOP archit
|
|||||||
|
|
||||||
{% highlight php %}
|
{% highlight php %}
|
||||||
<?php
|
<?php
|
||||||
$db = new PDO('mysql:host=localhost;dbname=testdb;charset=utf8', 'username', 'password');
|
$db = new PDO('mysql:host=localhost;dbname=testdb;charset=utf8mb4', 'username', 'password');
|
||||||
|
|
||||||
// Make your model available
|
// Make your model available
|
||||||
include 'models/FooModel.php';
|
include 'models/FooModel.php';
|
||||||
|
Reference in New Issue
Block a user