0
<?php
$query = "SELECT p.id as ItemId FROM production p";

$pdo -> beginTransaction();
// PDO
try {
    $pdo->setAttribute( PDO::ATTR_CASE, PDO::CASE_NATURAL );
    $result = $pdo->query($query);
    $test = $result->fetchAll(PDO::FETCH_ASSOC);
}
?>

In the answer I get it lowercased:

[{"itemid":1},{"itemid":2}]

My Problem is I want in the response the keys also CamelCased. Already tried using CASE_Natural but it does not make any change.

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
Doomenik
  • 868
  • 1
  • 12
  • 29

0 Answers0