how to find row number from table by specific cell content

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
arctushar
Forum Newbie
Posts: 5
Joined: Mon Aug 31, 2009 10:48 am

how to find row number from table by specific cell content

Post by arctushar »

I have a table with 10 row and 30 column. Now I need to find which row contain specific word in column 2.

Say there is a word find ind row 8 and column 2.
If someone submit find then my code will return the value 8
Can anybody help me
ocpaul20
Forum Newbie
Posts: 12
Joined: Thu Jul 05, 2007 3:53 am

Re: how to find row number from table by specific cell content

Post by ocpaul20 »

In MySQL? What is the table structure, field names, etc.?
What you are asking is probably a MySQL question and I assume you need something like
SELECT {row-number-fieldname} FROM {tablename} WHERE {fieldname_column2} = 'find';

You are going to have to look up a good MySQL tutorial and learn a bit of that. I dont think it will be practical for you to ask this kind of question for each time you need to do something as basic as this. We also need to know more information as I suggested above, otherwise you will only get generic answers as I have given. Anyway, I hope I have helped a little bit and good luck.
Post Reply