let say I have 2 table, which is user and photo table
user may have many photo, while a photo only have 1 user.
so I made user_id (foreign key)column in my photo table..
lemme give an example about my photo table..
id | name | url | user_id |
1 | bus | bus.jpg | 1 |
2 | car | car.jpg | 1 |
3 | plane | plane.jpg | 1 |
4 | train | train.jpg | 2 |
5 | bicycle | bcycle.jpg | 2 |
so, I now abit confusing about what query to run. My question is, how to echo 'all' the value on name and url, based only on user_id=1. May someone tell me, what query to run, and what function do I need to use?
If using 'while' how?
btw, I am making an image gallery...