The cubrid_num_rows function returns the number of rows in the query result. This is available only with the SELECT statement. Use cubrid_affected_rows() if you want to know the results of INSERT, UPDATE and DELETE queries. cubrid_num_rows() can be used only with synchronous queries. It returns 0 if the query is asynchronous.
int cubrid_num_rows (resource $req_identifier)
<?php
$conn = cubrid_connect("localhost", 33000, "demodb");
$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);
cubrid_disconnect($conn);
?>
The above example will output:
Row Num: 6
Column Num: 2