M Zubair Shamshad
M Zubair Shamshad

Reputation: 2741

Using Sqlite3 in objective C How to Retrieve the number of rows in a result set

after a long search didn't succeed to get the required and easily understandable answer i am putting here a question….. so please help me out on it….

I just want know that how i can get the number of rows in a result set of a query in objective C using sqlite3.

as we just use the function of SQL Server in PHP.

$Query = "SELECT XXXX FROM XXX";
    $rstRow = Sql_Query($Query);

if (sqlsrv_num_rows($rstRow) > 0)
{
    /* do something */
}

what is alternate to this in sqlite3.

Upvotes: 1

Views: 590

Answers (1)

abmussani
abmussani

Reputation: 461

Sqlite does not provide any function to get the number of rows return by a query. You can use SELECT COUNT(*) FROM table_name to get total number rows.

Reference: link

Upvotes: 1

Related Questions