IMPRESS dotted_line CONTACT dotted_line search dotted_line Kontakt dotted_line sitemap dotted_line print
182 PHP-Resource users online

Switch to another languags Deutsch aktuelle Sprache Englisch

PHP Manual


(PECL CUBRID >= 8.3.0)

cubrid_num_rowsGet the number of rows in the result set


int cubrid_num_rows ( resource $result )

The cubrid_num_rows() function is used to get the number of rows from the query result. You can use it only when the query executed is a select statement. When you want to know such value for INSERT, UPDATE, or DELETE query, you have to use the cubrid_affected_rows() function.

Note: The cubrid_num_rows() function can only be used for synchronous query; it returns 0 when it is used for asynchronous query.



result comes from a call to cubrid_execute(), cubrid_query() and cubrid_prepare()

Return Values

Number of rows, when process is successful.

0 when the query was done in async mode.

-1, if SQL statement is not SELECT.

FALSE when process is unsuccessful.


Example #1 cubrid_num_rows() example


$req cubrid_execute($conn"SELECT * FROM code");

$row_num cubrid_num_rows($req);
$col_num cubrid_num_cols($req);

printf("Row Num: %d\nColumn Num: %d\n"$row_num$col_num);


The above example will output:

Row Num: 6
Column Num: 2

See Also

Comments to the PHP manual
Write new comment


New Tutorial entries

Migration einer PHP 5 App auf PHP 7

Dieses PHP 7 Tutorial zeigt dir, wie du dein PHP5 Script auf PHP7 umstellst.

Berni | Category: PHP
PHP 7 Virtual Machine

Dieser Artikel zielt darauf ab, einen Überblick über die Zend Virtual Machine, wie es in PHP 7 gefunden wird.

Berni | Category: PHP
plotting masters - a professional guide - Teil II

Grafische Interpolation und Bestapproximation von numerischen Wertepaaren: Wir wollen Punkte auf einer Zeichenebene über verschiedene Verfahren miteinander verbinden.

EVAMasters | Category: PHP