PHP/MySQLi: SET lc_time_names and DATE_FORMAT() into a mysqli query?

前端 未结 3 1683
一生所求
一生所求 2021-01-16 07:01

I use the next code to retrieve data from a table in the database:

$check_sql = \'SELECT personID, name, DATE_FORMAT(persons.birthdate, \"%d de %M, %Y\"), bi         


        
3条回答
  •  無奈伤痛
    2021-01-16 07:12

    Another option is to return the raw date/time and then format it in PHP.

    Before you format the date, you can use the setlocale() function in PHP to get Spanish output.

    This has the added benefit of not running a function in mysql, which can be slower.

提交回复
热议问题