tags:

views:

21

answers:

1
$sql = 'select ...';

$result = mysql_query($sql,$con);

Is there a function for this?

+5  A: 

mysql_num_rows()

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().

Pekka