Page 1 of 1

how to find row number from table by specific cell content

Posted: Mon Aug 31, 2009 7:18 pm
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

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

Posted: Mon Aug 31, 2009 8:52 pm
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.