sql >> Base de Datos >  >> RDS >> Mysql

PHP/MySQLi:¿CONFIGURAR lc_time_names y DATE_FORMAT() en una consulta mysqli?

$mysqli = new mysqli("localhost", "my_user", "my_password", "world");
$mysqli->query("SET lc_time_names = 'es_ES'");
$check_sql = 'SELECT personID, name, DATE_FORMAT(persons.birthdate, "%d de %M, %Y"), birthplace, countryID FROM persons WHERE personID = ?';
        if ($stmt = $mysqli->prepare($check_sql)) {
                $stmt->bind_param('i', $pid);
                $stmt->bind_result($personDB, $name, $birthdate, $birthplace, $countryID);
                $stmt->execute();
                $stmt->fetch();
        }