# Num\_Rows

**URL:** <https://forum.kirupa.com/t/num-rows/312019>\
**Category:** programming\
**Created:** [July 22, 2010, 4:01pm UTC](https://forum.kirupa.com/t/num-rows/312019 "2010-07-22T16:01:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mirrorimg](https://avatars.discourse-cdn.com/v4/letter/m/e68b1a/32.png) [@mirrorimg](https://forum.kirupa.com/u/mirrorimg)\
**Post date:** [July 22, 2010, 4:01pm UTC](https://forum.kirupa.com/t/num-rows/312019/1 "2010-07-22T16:01:11Z")

</div>

I am trying to find the number of rows in a SQL query and my echo is returning “Array1” or “Array2” , etc. Its not actually giving me a number value. I thought that before it would actually give me a number.

EDIT: Jumped the gun. Apparently I had another echo that was returning the “Array” message. The count was just hidden from me. This thread can be deleted. (I would do it, but I dont see an option to delete the thread)

```php
$S= mysql_query ("SELECT CA FROM ca WHERE CA='".$CA2."' AND Resporg='".$Resp."'");
echo "SELECT CA FROM ca WHERE CA='".$CA2."' AND Resporg='".$Resp."'"."<BR>";
$sqlcount= mysql_num_rows ($S);
echo $sqlcount."<BR>"; //How many records does my SQL have?

```

I’m trying to pass the number of rows from the $sqlcount into a loop. I believe it’s not making it into that loop because it doesn’t know what this value is.
