Switch to: V11V10V9V8V7V6V5

valentina_num_rows()

Declaration

int valentina_num_rows ( resource result )

Parameters

Name Description
result The result resource that is being evaluated. This result comes from a call to valentina_query().

Description

Retrieves the number of rows from a result set. This command is only valid for SELECT statements. To retrieve the number of rows affected by a INSERT, UPDATE, or DELETE query, use valentina_affected_rows().

Return Values

The number of rows in a result set on success, or FALSE on failure.

Examples

Example 1.

<?php
 
$link = valentina_connect("localhost", "val_user", "val_password");
valentina_select_db("database", $link);
 
$result = valentina_query("SELECT * FROM table1", $link);
$num_rows = valentina_num_rows($result);
 
echo "$num_rows Rows\n";
 
?> 

See Also