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
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
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.