Does mysql support rowcount when using it in asp.I am trying to display every other reocrd displayed in my asp page indented.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Hi thenone,

Since you have not yet gotten a comment I'll try to help you out.
You could add an extra field COUNT(column_name) as num_rows, so it would look like:
SELECT *, COUNT(column_name) as num_rows, FROM table

Joe P
thenoneAuthor Commented:
you have tried to help me with this before I belive and I still can't get it to work because I am not sure if mysql supports it this way.

rowcount = rowcount + 1

if rowcount = 2 then
rowcount = 0

if rowcount = 0 then
style = text:indent 10 px
style = text:indent 0px
end if

Then I have my for loop in my table

In php, after the query I would just do:
$numOfRows =  mysql_num_rows();
Is there such a function in ASP?  To count the number of rows?
This pulls the responsibility away from mysql and into ASP, is that okay?

Joe P
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

hi thenone,

i guess you use an ado-recordset in your asp, to retreive the records, so after Recordset.Open you can retreive the recordcount with Recordset.RecordCount:

Dim rst as new ADODB.Recordset
Dim count as Long

rst.Open "Select ..."
count = rst.RecordCount

hope it helps :)
select @rnum:=(@rnum+1)%2 AS parity, * from table
you can do it in two steps. LIke

first execute this querry to get the no of rows

SELECT COUNT(*) as num_rows, FROM table WHERE<your Condition>

then execute ur querry normally

SELECT *  FROM table WHERE<your Condition>


hey guys, we dont need to reinvent the wheel .. ado-recordset-object has a method for that ...


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
And although its true pradapkumar, executing two querries would probably not be the best way to do this.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
MySQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.