zerocool786
January 15th, 2011, 19:57
I want users to choose, which album they want view their photos to appear on certain page. Everything works fine with my SQL and coding regarding pulling albums ID, or photos id, using separate SQL.
Below is the SQL I use to get users photos from the latest album.
$query1 = "SELECT pid, link, src, src_big, caption FROM photo WHERE aid IN ( SELECT aid FROM album WHERE owner=".$uid.") ORDER BY created DESC LIMIT 4";
Right after WHERE owner=".$uid." I want to enter "AND aid=???" .how do I go about having certain aid number based on what users chooses.
Note:
aid=album id
pid=photo id
when I manually type album id, the query gives me good result. I want to base it on users choose/input.
thanks
Below is the SQL I use to get users photos from the latest album.
$query1 = "SELECT pid, link, src, src_big, caption FROM photo WHERE aid IN ( SELECT aid FROM album WHERE owner=".$uid.") ORDER BY created DESC LIMIT 4";
Right after WHERE owner=".$uid." I want to enter "AND aid=???" .how do I go about having certain aid number based on what users chooses.
Note:
aid=album id
pid=photo id
when I manually type album id, the query gives me good result. I want to base it on users choose/input.
thanks