Mysql 中和同to_char 一样用法的函数

STR_TO_DATE()

		$sql = " SELECT ";
		$sql .= " m_img,m_content,STR_TO_DATE(m_time,\"%Y-%m-%d\") as m_time ";
		$sql .= " FROM ";
		$sql .= " message "; 
		$sql .= " ORDER BY message.m_time DESC ";
		$rs = $this->db->query($sql); 
		$ClickArticle = $rs->result();	
		return $ClickArticle;

 

posted on 2015-03-10 23:12  手撕高达的村长  阅读(2922)  评论(0编辑  收藏  举报

导航