Display the drop-down list

Test of PDOStatement::fetchColumn()

Example #1 : test success
Example #2 : test success
Example #1
$input = [
  
'exec_statement' => 'CREATE TABLE fruit
                    (name, colour, calories INT];

                INSERT INTO fruit VALUES
                    (\'apple\', \'red\', 150],
                    (\'banana\', \'yellow\', 250],
                    (\'kiwi\', \'brown\', 75],
                    (\'lemon\', \'yellow\', 25],
                    (\'orange\', \'orange\', 300],
                    (\'pear\', \'green\', 150],
                    (\'watermelon\', \'pink\', 90)'
,
  
'statement' => 'SELECT name, colour, calories FROM fruit',
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'pdo' => 'PDO instance',
    
'int' => 7,
    
'pdostatement' => 'PDOStatement instance',
    
'bool' => true,
    
'string' => 'apple',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]
Example #2
$input = [
  
'exec_statement' => 'CREATE TABLE fruit
                    (name, colour, calories INT];

                INSERT INTO fruit VALUES
                    (\'apple\', \'red\', 150],
                    (\'banana\', \'yellow\', 250],
                    (\'kiwi\', \'brown\', 75],
                    (\'lemon\', \'yellow\', 25],
                    (\'orange\', \'orange\', 300],
                    (\'pear\', \'green\', 150],
                    (\'watermelon\', \'pink\', 90)'
,
  
'statement' => 'SELECT name, colour, calories FROM fruit',
  
=> 1,
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'pdo' => 'PDO instance',
    
'int' => 7,
    
'pdostatement' => 'PDOStatement instance',
    
'bool' => true,
    
'string' => 'red',
  ],
  
'php_version' => '7.1.30 Linux x86_64',
]