I'm having trouble with a query and hopefully someone can help me.
I have two tables in my database that I'm trying to join, so I can retrieve the art from the database but by what the user has stored.
art
artid thumbnail_url
1 images/pic.jpg
2 images/smile.jpg
users_art
userid artid
1 1
1 2
as you can tell, artid is the same and I'm trying to join them in my query. I came up with this:
PHP Code:
$query = "SELECT art.thumbnail, users_art.userid FROM art, users_art WHERE art.artid = users_art.artid AND users_art.userid='$temp_id'";
$temp_id is the user's ID, so when they login it can pull the results by the user. I get no results, so I assume something is wrong.
|