Here is an example:
<?php
$query = "SELECT * FROM 't1' ";
$result = $db->query($query) or die("Error in query: <span style='color:red;'>$query</span>");
$num_columns = $result->numColumns();
?>
[Edited by: googleguy@php.net]
(PHP 5 >= 5.3.0, PHP 7, PHP 8)
SQLite3Result::numColumns — Returns the number of columns in the result set
Returns the number of columns in the result set.
This function has no parameters.
Returns the number of columns in the result set.
Here is an example:
<?php
$query = "SELECT * FROM 't1' ";
$result = $db->query($query) or die("Error in query: <span style='color:red;'>$query</span>");
$num_columns = $result->numColumns();
?>
[Edited by: googleguy@php.net]