问题
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
回答1:
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.
来源:https://stackoverflow.com/questions/9464600/pdo-prepare-statenent-is-returning-only-column-names-instead-of-values