Chazy
-
Posts
1 -
Joined
-
Last visited
Posts posted by Chazy
-
-
Hi everyone!
I just started my first php project and I think I'm going to need some help from the experts
I've never done something (this complex?) like this, a real website to share with friends and all the internet.
Also I'll try my best to help others as much as i can...
And ofc, I hope I improve my phpfreaks skills.
join queries and get counts
in MySQL Help
Posted
Hi! I'm trying to get working a photo list (library) that I made for my website. I need to query db for somethings and I have to join them all but I'm not very familiarize with this tecquine, neither COUNT/SUM.
First I need to get (all) the images from user_uploads table (imgID, user_id, filename, description, up_time, etc), second get the user info from members table (id, name and usr_img) where id = user_uploads.user_id, third and last make 2 counts to know if the logged in user already liked the img ($_SERVER['user_id']) and get the total likes the current "user_uploads.img_id" have.
I'm already tried many queries, joining, subquery and finally I'm going to try again joining (or inner join). This is what I have:
And this is the php code:
I'm not sure how to do this and I'd appreciate any help.
Thanks in advance!