ãã¼ã¿ãã¼ã¹ã¢ã¯ã»ã¹ã¯ã©ã¹
ãã£ã±ãDBã¢ã¯ã»ã¹ç¨ã®ã©ã¤ãã©ãªããªãã¨ä¸ä¾¿ãªã®ã§ãç°¡æçãªã¯ã©ã¹ãä½ããã¨ã«ã
次ã®Moonyã®ãªãªã¼ã¹ã«å«ããäºå®ãã¯ã©ã¹åã¯Moony_DBã
- å é¨ã§PEAR::DBãå©ç¨
- ãã¬ã¼ã¹ãã«ãã¼ãå«ãSQLãå®è¡å¯è½
- ç°¡åãªãã©ã³ã¶ã¯ã·ã§ã³å¶å¾¡ãå¯è½
- æ¤ç´¢ã¡ã½ãããå®è¡ããå ´åãæ¤ç´¢çµæãé£æ³é åã®é åã¨ãã¦è¿ã
- æ´æ°ã¡ã½ãããå®è¡ããå ´åãå½±é¿ãåã¼ããã¬ã³ã¼ãæ°ãè¿ã
- å®è¡ããSQLããã°åºåãããã¨ãå¯è½ï¼ãã°ã¬ãã«ã¯ãããã°ï¼
- æ¤ç´¢çµæã®æåã¨ã³ã³ã¼ãã£ã³ã°ã®èªåå¤æãè¡ã
æ¤ç´¢ã¡ã½ããã¯ãããªæã:
function query($sql, $params = null, $log = false) { $result = array(); if ($log) { Moony_Logger::debug($this->_getLog($sql, $params), __FILE__, __LINE__); } $result = $this->_db->getAll($sql, $params, DB_FETCHMODE_ASSOC); if (DB::isError($result)) { if ($this->_in_trans) { $this->rollback(); } Moony_Error::raise($result->getMessage(), __FILE__, __LINE__); } if (isset($this->_db_encoding)) { mb_convert_variables(MOONY_INTERNAL_ENCODING, $this->_db_encoding, &$result); } return $result; }