DB_result::numCols()

DB_result::numCols() – Gets number of columns in a result set

Synopsis

integer numCols ( )

Description

Get the number of columns of the rows in a result set.

Return value

integer - number of columns or a DB_Error object on failure

Note

This function can not be called statically.

Example

Using numCols()

<?php
// Once you have a valid DB object named $db...
$res =& $db->query('SELECT * FROM phptest');
echo 
$res->numCols();
?>
Gets result sets from multiple queries (Previous) Gets number of rows in a result set (Next)
Last updated: Sat, 16 Feb 2019 — Download Documentation
Do you think that something on this page is wrong? Please file a bug report.
View this page in:
  • English

User Notes:

There are no user contributed notes for this page.