我的PDO查询似乎随机停止工作?

时间:2017-04-05 22:10:10

标签: php

如何进一步排查问题?我有3种查询方式。这是针对fetchType ='单个' (单行)和填充的parameterArray

public function query($fetchType, $queryType, $parameterArray=null)
{
    $query=$this->sql_array[$queryType];
    if($parameterArray==null)
    {
        $pdoStatement = $this->db_one->query($query);
        $results = $pdoStatement->fetchAll(PDO::FETCH_ASSOC);
        return $results;
    }
    $this->db_one->quote($query);
    $pdoStatement = $this->db_one->prepare($query);
    $results = $pdoStatement->execute($parameterArray);
    if($fetchType=='single')
    {
        $results = $pdoStatement->fetch(PDO::FETCH_ASSOC);
    }
    else if($fetchType=='multiple')
    {
        $results = $pdoStatement->fetchAll(PDO::FETCH_ASSOC);
    }
    return $results;
}

我的结果是假的,我在sql表中看不到任何数据。

我验证了queryType存在于查找表中,并且其他查询正在运行。

这是实际查询。我插入新行以使其可读。

"signup_insert" =>            
"INSERT INTO credentials 
(h_token, h_file, h_pass, email, name, picture, privacy) 
VALUES (?, ?, ?, ?, ?, ?, ?)"

这是我创建的调试代码:

$pipe['debug_h_token']=$h_token;
$pipe['debug_h_file']=$h_file;
$pipe['debug_h_pass']=$h_pass;
$pipe['debug_email']=$this->TO->get('email');
$pipe['debug_name']=$this->TO->get('name');
$pipe['debug_picture']=$picture;
$pipe['debug_privacy']=$privacy;

$test = $this->DBO->query('single', 'signup_insert', array(
    $h_token,
    $h_file,
    $h_pass,
    $this->TO->get('email'),
    $this->TO->get('name'),
    $picture,
    $privacy
));
$pipe['debug_test'] = $test;

0 个答案:

没有答案