fetching multiple rows in the same page

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
edoplaza
Forum Newbie
Posts: 2
Joined: Sun Oct 12, 2008 9:39 am

fetching multiple rows in the same page

Post 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
User avatar
Eran
DevNet Master
Posts: 3549
Joined: Fri Jan 18, 2008 12:36 am
Location: Israel, ME

Re: fetching multiple rows in the same page

Post by Eran »

Code: Select all

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