0
I have the following query that picks the user’s bookmarks ID=X
$sql="SELECT * FROM user WHERE id IN (SELECT user_2_id FROM favoritos WHERE
user_1_id =$id_user_logado)";
Now, how can I get the user photo of the users leaving this query? The id
photo is stored in the user table in the field photo_p_id
and the information related to the photo is in the table photos
as the location of the.
Something like this:
$sql="SELECT * FROM user WHERE id IN
(SELECT user_2_id FROM favoritos WHERE
user_1_id =$id_user_logado)
LEFT JOIN photos AS p
ON user.photo_p_id=p.id
";