Mysql MONTHNAME in Italiano

  • Creatore Discussione Creatore Discussione max1974
  • Data di inizio Data di inizio

max1974

Utente Attivo
7 Mar 2013
107
0
16
salve a tutti ,
se scrivo dentro Mysql
Codice:
SET lc_time_names = "it_IT";
SELECT MONTHNAME('2021-12-07') AS 'Result';
tutto funziona correttamnte ......
Result = Dicembre

Invece se lo metto dentro PHP in
Codice:
$sql ="SET lc_time_names = 'it_IT'; SELECT MONTHNAME('2021-12-07') AS 'Result';";
$result = $connect->query($sql);
if ($result->num_rows > 0) {
..............etc....
ricevo ERRORE:
Notice: Trying to get property of non-object in
 
salve a tutti ,
se scrivo dentro Mysql
Codice:
SET lc_time_names = "it_IT";
SELECT MONTHNAME('2021-12-07') AS 'Result';
tutto funziona correttamnte ......
Result = Dicembre

Invece se lo metto dentro PHP in
Codice:
$sql ="SET lc_time_names = 'it_IT'; SELECT MONTHNAME('2021-12-07') AS 'Result';";
$result = $connect->query($sql);
if ($result->num_rows > 0) {
..............etc....
ricevo ERRORE:
Notice: Trying to get property of non-object in
Mi rispondo da solo......
sono uno scemo ma a quest'ora....
Codice:
$connect->query("SET lc_time_names = 'it_IT'");
$sql ="SELECT MONTHNAME('2021-12-07') AS 'Result';";
$result = $connect->query($sql);
if ($result->num_rows > 0) {

Grazie lo stesso a tutti!!!!
 

Discussioni simili