YEAR in active record - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11) +--- Thread: YEAR in active record (/showthread.php?tid=71795) |
YEAR in active record - pippuccio76 - 09-25-2018 HI , i have a table : `id` bigint(20) UNSIGNED NOT NULL, `data` date NOT NULL, `numero_settimana` int(11) NOT NULL, `giorno_settimanale` varchar(15) NOT NULL, `orari_apertura_id` int(11) NOT NULL, `stato_agenda_id` int(10) UNSIGNED NOT NULL COMMENT '= aperto chiuso o prenotato', `clienti_id` int(10) UNSIGNED DEFAULT NULL, `note` varchar(100) DEFAULT NULL This is a part my function : PHP Code: getweek($numsettimana,$data,$tabella){ RE: YEAR in active record - InsiteFX - 09-25-2018 Try this and see if it is what you want, not tested. PHP Code: $query = $this->db->select('SELECT DATE("{$data}") as required_DATE') RE: YEAR in active record - davicotico - 09-25-2018 PHP Code: function getweek($numsettimana, $data, $tabella){ RE: YEAR in active record - Gurutechnolabs - 10-01-2018 Hello, I just read your question. I think you need to change the data type. you have to need to change your field data type for 'numero_settimana' int to DATE. Hope it will help you friend. |