PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

mssql_pconnect> <mssql_num_fields
Last updated: Fri, 22 Aug 2008

view this page in

mssql_num_rows

(PHP 4, PHP 5, PECL odbtp:1.1.1-1.1.4)

mssql_num_rowsobtiene el número de filas de la consulta

Descripción

int mssql_num_rows ( string $result )

mssql_num_rows() devuelve el número de filas de la consulta o result set.

Ver también: mssql_db_query(), mssql_query() and, mssql_fetch_row().



add a note add a note User Contributed Notes
mssql_num_rows
jose_dandrade at yahoo dot com
15-Dec-2006 04:45
When connecting to MS SQL, I think it is not right to try mssql_num_rows() or mssql_free_result() on a DELETE Query. Because there is nothing to return.

    $db = mssql_connect('server','user','password') or die('No Connection');
    mssql_select_db('database',$db);
   
    $rs2 = mssql_query('DELETE from table',$db);
    $p = mssql_num_rows($rs2);
    mssql_free_result($rs2);

You might receive a warning like:

Warning: mssql_num_rows(): supplied argument is not a valid MS SQL-result resource
h dot schuemann at cyquest-ag dot de
13-Nov-2000 07:13
For getting something like "mssql_affected_rows" call:

<?php
$rsRows
= mssql_query("select @@rowcount as rows", $db);
$rows = mssql_result($rsRows, 0, "rows");
?>

after execution of the query (UPDATE, INSERT or DELETE).

mssql_pconnect> <mssql_num_fields
Last updated: Fri, 22 Aug 2008
 
 
show source | credits | sitemap | contact | advertising | mirror sites