Page 1 of 1

Multiple search option.

Posted: Thu Jul 05, 2007 12:59 pm
by catacaz
How can I search in a coloumn from table in database 2 different recordings and display them in a html table?

My table looks like this:

-|----|----|--|
1 text text A
2 text text B
3 text text A
4 text text C
5 text text B

and I want to search only the recordings with contains A and B, like this:

-|----|----|--|
1 text text A
2 text text A
3 text text B
4 text text B

Posted: Thu Jul 05, 2007 1:19 pm
by ReverendDexter
I know that displaying a resultset from a database has been posted elsewhere before, so I'll only address the two items from the column bit.

You can do this with a OR clause in your sql statement, i.e.

Code: Select all

SELECT *
FROM table
WHERE app_column = 'A'
OR app_column = 'B'
ORDER BY app_column
Hope that helps!

EDIT: I didn't see you wanted it ordered, so I fixed the query to do that