PHP  
 PHP_5_4
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

Test Failure Report for ext/pdo_odbc/tests/pdo_028.phpt ('ODBC PDO Common: bindValue')

Script

1: <?php
2:
if (getenv('REDIR_TEST_DIR') === falseputenv('REDIR_TEST_DIR='.dirname(__FILE__) . '/../../pdo/tests/');
3: require_once 
getenv('REDIR_TEST_DIR') . 'pdo_test.inc';
4:
$db PDOTest::factory();
5:
6:
$db->exec('CREATE TABLE test(id int NOT NULL PRIMARY KEY, val1 VARCHAR(10), val2 VARCHAR(10), val3 VARCHAR(10))');
7:
$stmt $db->prepare('INSERT INTO test values (1, ?, ?, ?)');
8:
9:
$data = array("one""two""three");
10:
11: foreach (
$data as $i => $v) {
12:     
$stmt->bindValue($i+1$v);
13: }
14:
$stmt->execute();
15:
16:
$stmt $db->prepare('SELECT * from test');
17:
$stmt->execute();
18:
19:
var_dump($stmt->fetchAll(PDO::FETCH_ASSOC));
20:
?>
21:

Expected

array(1) {
  [0]=>
  array(4) {
    ["id"]=>
    string(1) "1"
    ["val1"]=>
    string(3) "one"
    ["val2"]=>
    string(3) "two"
    ["val3"]=>
    string(5) "three"
  }
}

Output

Warning: PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access violation: 1064 [MySQL][ODBC 5.1 Driver][mysqld-5.1.73]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' , )' at line 1 (SQLExecute[1064] at /var/php_gcov/PHP_5_4/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_4/ext/pdo_odbc/tests/pdo_028.php on line 14
array(0) {
}

Diff

# original source file: ext/pdo/tests/pdo_028.phpt
001+ Warning: PDOStatement::execute(): SQLSTATE[42000]: Syntax error or access violation: 1064 [MySQL][ODBC 5.1 Driver][mysqld-5.1.73]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' , )' at line 1 (SQLExecute[1064] at /var/php_gcov/PHP_5_4/ext/pdo_odbc/odbc_stmt.c:254) in /var/php_gcov/PHP_5_4/ext/pdo_odbc/tests/pdo_028.php on line 14
002+ array(0) {
003+ }
001- array(1) {
002-   [0]=>
003-   array(4) {
004-     ["id"]=>
005-     string(1) "1"
006-     ["val1"]=>
007-     string(3) "one"
008-     ["val2"]=>
009-     string(3) "two"
010-     ["val3"]=>
011-     string(5) "three"
012-   }
013- }

 

Generated at Fri, 24 Oct 2014 05:22:02 +0000 (6 days ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.