Page 1 of 1

fetching multiple rows in the same page

Posted: Sun Oct 12, 2008 9:54 am
by edoplaza
Hello,

I'm very new to php - MySQL. I've just learnt how to fetch a specific row from a db using the WHERE clause.

example: "SELECT * FROM articles WHERE id=2"

Now, let's say I want to display multiple specific rows, selected by their id's, like rows number 2, 10 and 14 and place them in in different cells of a unique html table... how do I do that?

Any help will be appreciated,

Thanks

Eduardo

Re: fetching multiple rows in the same page

Posted: Sun Oct 12, 2008 10:17 am
by Eran

Code: Select all

 
SELECT * FROM articles WHERE id IN (2,10,4)