0

I have written a function using PDO Prepare Statement to fetch columns from a table.

But its returning only the column names..

Could anyone help..

Thanks in Advance

EscalinNancy
  • 1,252
  • 3
  • 10
  • 13

1 Answers1

0

Maybe if you can paste some code we could help. The typical PDO example is like the following:

<?php
function getFruit($conn) {
  $sql = 'SELECT name, color, calories FROM fruit ORDER BY name';
  foreach ($conn->query($sql) as $row) {
    print $row['name'] . "\t";
    print $row['color'] . "\t";
    print $row['calories'] . "\n";
  }
}
?>

Check your code and please, let us know more details about it.

oscarmlage
  • 1,445
  • 2
  • 12
  • 23