Monday 9 September 2013

MySQL getting tables info where

MySQL getting tables info where

I'm struggling to link 2 tables together so that I can fill out
information for my PHP script
I have 2 tables feed and u_feed
U_FEED
id | uid | fid
1 | 2 | 1
FEED
id | url | title | favicon
1 | http://example.com | domain | http://example.com/favicon.ico
The current user id (uid) will be 2
I have tried but to no luck
SELECT u.uid, f.url, f.title, f.favicon
FROM u_feed u
JOIN feed f ON u.fid = '2'

No comments:

Post a Comment