(PHP 5 >= 5.3.0)
SQLite3Result::columnName — Returns the name of the nth column
Returns the name of the column specified by the column_number.
The numeric zero-based index of the column.
Returns the string name of the column identified by column_number.
Example:
<?php
public function selectAll($table)
{
$results = $this->_dbConn->query("SELECT * FROM $table");
$cols = $results->numColumns();
while ($row = $results->fetchArray()) {
for ($i = 1; $i < $cols; $i++) {
echo $results->columnName($i) . ': ';
echo $row[$i] . '<br />';
}
//print_r($row);
//echo 'Username: ' . $row['USERNAME'] . '<br />';
}
$this->_dbConn->close();
}
?>