Hello ppl,
I have a mysql db and i want to know how is better to use queryes on my website
in the table favorite i have many rows with id (some numbers..) and fav ( img1 img2 img3 img4 img5 etc..)
and a table named img where the first id is img1 for example
so wich metod is better to use for getting all img info from the db:
1: using SELECT * FROM img WHERE id='img1' || id='img2' || id='img3'...etc
(and here how many || or && i can use in one query ?! because the row FAV in table FAVORITE can have a large number of favorite images)
2: or using queries for each img: SELECT * FROM img WHERE id='img1'
$img1info = dbquery..
SELECT * FROM img WHERE id='img2'
$img2info = dbquery..
etc........
wich method is better? or is an easyer way to get info for all the images located in the fav row?! from the favorite table..??
sorry for my bad english... please help me , even if you are not an expert suggestions are god for me thanks a lot