FBSQL_NUM_ROWS(3) 1 FBSQL_NUM_ROWS(3)fbsql_num_rows - Get number of rows in resultSYNOPSIS
int fbsql_num_rows (resource $result)
DESCRIPTION
Gets the number of rows in the given $result set.
This function is only valid for SELECT statements. To retrieve the number of rows returned from a INSERT, UPDATE or DELETE query, use
fbsql_affected_rows(3).
PARAMETERS
o $
result -A result identifier returned by fbsql_query(3) or fbsql_db_query(3).
RETURN VALUES
Returns the number of rows returned by the last SELECT statement.
EXAMPLES
Example #1
fbsql_num_rows(3) example
<?php
$link = fbsql_connect("localhost", "username", "password");
fbsql_select_db("database", $link);
$result = fbsql_query("SELECT * FROM table1;", $link);
$num_rows = fbsql_num_rows($result);
echo "$num_rows Rows
";
?>
SEE ALSO fbsql_affected_rows(3), fbsql_connect(3), fbsql_select_db(3), fbsql_query(3).
PHP Documentation Group FBSQL_NUM_ROWS(3)
Check Out this Related Man Page
MYSQL_NUM_ROWS(3) 1 MYSQL_NUM_ROWS(3)mysql_num_rows - Get number of rows in resultSYNOPSIS
Warning
This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQL extension should
be used. See also MySQL: choosing an API guide and related FAQ for more information. Alternatives to this function include:
omysqli_stmt_num_rows(3)
o PDOStatement::rowCount
int mysql_num_rows (resource $result)
DESCRIPTION
Retrieves the number of rows from a result set. This command is only valid for statements like SELECT or SHOW that return an actual result
set. To retrieve the number of rows affected by a INSERT, UPDATE, REPLACE or DELETE query, use mysql_affected_rows(3).
o $
result -The result resource that is being evaluated. This result comes from a call to mysql_query(3).
The number of rows in a result set on success or FALSE on failure.
Example #1
mysql_num_rows(3) example
<?php
$link = mysql_connect("localhost", "mysql_user", "mysql_password");
mysql_select_db("database", $link);
$result = mysql_query("SELECT * FROM table1", $link);
$num_rows = mysql_num_rows($result);
echo "$num_rows Rows
";
?>
Note
If you use mysql_unbuffered_query(3), mysql_num_rows(3) will not return the correct value until all the rows in the result set have
been retrieved.
Note
For backward compatibility, the following deprecated alias may be used: mysql_numrows(3)mysql_affected_rows(3), mysql_connect(3), mysql_data_seek(3), mysql_select_db(3), mysql_query(3).
PHP Documentation Group MYSQL_NUM_ROWS(3)
Hi All
I like to know how can we calculate the number of rows and the average of the values present in the file. I will not know what will be the rowcount, which will be dynamic in nature of the file.
eg.
29
33
48
30
28 (6 Replies)
Hi all,
Wondering is this possible:
SELECT id AS cid, name, phone, url, streettype, IFNULL((SELECT ROUND(AVG(stars)*2, 1) / 2 FROM " . $dbconf{'prefix'} . "reviews WHERE location=cid) AS avgstars,0), ...
OR should it be:
SELECT id AS cid, name, phone, url, streettype, (SELECT ... (0 Replies)
Hi,
Please help me in following prob.
I have a input file in which UPDATE statements will be present. I need to check the count of the rows impacted by each statement. I am using below code to do so:
$dml --> File having UPDATE SQLs like
Update <table_name> Set <field>=<value>... (3 Replies)
Hi ,
I have a CSV file that has around 50K records in it. I have to delete all the duplicate rows from the file except one, depending upon data in column4.
Lets say there are 3 rows for 'column4data' in the file. I have to retain only that line which has the smallest date value in column2.... (3 Replies)