Mysql
 sql >> Database >  >> RDS >> Mysql

PHP/MySQLi:SET lc_time_names e DATE_FORMAT() in una query 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();
        }