CodeIgniter不提取整个字段数据

时间:2014-11-19 14:36:27

标签: php codeigniter pdo freetds unixodbc

我正在使用CodeIgniter通过unixODBC和FreeTDS联系旧的MSSQL 6.5数据库。 连接工作正常,我可以运行查询,但问题是id不返回整个字段数据。

Ex. ["Frame9Val"]=> string(3) "13"

- >应该显示135

["Frame1BVal"]=> string(3) "2�"

- >应该显示255

为什么会发生这种情况以及如何解决这个问题?

只使用PDO制作了一个test-php,它运行正常。

        $this->db->select('tblScore.SessionNum, 
                        tblScore.GameNum, 
                        tblScore.LaneId, 
                        tblScore.PlayerCnt,
                        tblPlayerScore.BowlerName,
                        tblFrameScore.Frame1Val,
                        tblFrameScore.Frame2Val,
                        tblFrameScore.Frame3Val,
                        tblFrameScore.Frame4Val,
                        tblFrameScore.Frame5Val,
                        tblFrameScore.Frame6Val,
                        tblFrameScore.Frame7Val,
                        tblFrameScore.Frame8Val,
                        tblFrameScore.Frame9Val,
                        tblFrameScore.Frame10Val,
                        tblPinfall.Frame1AVal,
                        tblPinfall.Frame1BVal,
                        tblPinfall.Frame2AVal,
                        tblPinfall.Frame2BVal,
                        tblPinfall.Frame3AVal, 
                        tblPinfall.Frame3BVal, 
                        tblPinfall.Frame4AVal, 
                        tblPinfall.Frame4BVal, 
                        tblPinfall.Frame5AVal, 
                        tblPinfall.Frame5BVal, 
                        tblPinfall.Frame6AVal, 
                        tblPinfall.Frame6BVal, 
                        tblPinfall.Frame7AVal, 
                        tblPinfall.Frame7BVal, 
                        tblPinfall.Frame8AVal, 
                        tblPinfall.Frame8BVal, 
                        tblPinfall.Frame9AVal, 
                        tblPinfall.Frame9BVal,
                        tblPinfall.Frame10AVal, 
                        tblPinfall.Frame10BVal, 
                        tblPinfall.Frame11AVal');
    $this->db->from('tblScore, tblPlayerScore, tblPinfall, tblFrameScore');
    $this->db->where('tblScore.SessionNum = tblPlayerScore.SessionNum');
    $this->db->where('tblScore.LaneId = tblPlayerScore.LaneId');
    $this->db->where('tblScore.GameNum = tblPlayerScore.GameNum');
    $this->db->where('tblPlayerScore.SessionNum = tblFrameScore.SessionNum');
    $this->db->where('tblPlayerScore.LaneId = tblFrameScore.LaneId');
    $this->db->where('tblPlayerScore.GameNum = tblFrameScore.GameNum');
    $this->db->where('tblPlayerScore.BowlerNum = tblFrameScore.BowlerNum');
    $this->db->where('tblPlayerScore.SessionNum = tblPinfall.SessionNum');
    $this->db->where('tblPlayerScore.LaneId = tblPinfall.LaneId');
    $this->db->where('tblPlayerScore.GameNum = tblPinfall.GameNum');
    $this->db->where('tblPlayerScore.BowlerNum = tblPinfall.BowlerNum');
    $this->db->where('tblScore.SessionNum', intval($sessionNum));
    $this->db->where('tblScore.LaneId', intval($laneId));
    $this->db->where('tblScore.GameNum', intval($gameNum));
    $query = $this->db->get();
    echo '<pre>';var_dump($query->result());echo'</pre>';
    return $query->result_array();

0 个答案:

没有答案