Display the drop-down list

Test of PDOStatement::execute()

Example #1 : test success
Example #2 : test success
Example #3 : 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,
  ],
  
'php_version' => '7.1.17 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
                WHERE calories <= :calories AND colour = :colour'
,
  
=> [
    
':calories' => 150,
    
':colour' => 'red',
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'pdo' => 'PDO instance',
    
'int' => 7,
    
'pdostatement' => 'PDOStatement instance',
    
'bool' => true,
  ],
  
'php_version' => '7.1.17 Linux x86_64',
]
Example #3
$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
                WHERE calories <= ? AND colour = ?'
,
  
=> [
    
=> 150,
    
=> 'red',
  ],
]
$expected_output = $test_output
$test_output = [
  
'result' => [
    
'pdo' => 'PDO instance',
    
'int' => 7,
    
'pdostatement' => 'PDOStatement instance',
    
'bool' => true,
  ],
  
'php_version' => '7.1.17 Linux x86_64',
]