angel1987 Posted June 27, 2010 Share Posted June 27, 2010 Hi, i need some help please... Tablename : userdetails ID username password emailid 1 abc xyz a@b.com Tablename: articles ID title content submittedby 1 hello world some content 1 Now i have the title of an article which is "hello world" and from this title i want to find an emailid of the user who submitted that article. I think it can be done through JOIN thing but since i am learning i am stuck on it, so please help me. Quote Link to comment Share on other sites More sharing options...
Mchl Posted June 27, 2010 Share Posted June 27, 2010 SELECT u.emailid FROM users AS u INNER JOIN articles AS a ON a.submittedby = u.ID WHERE a.title = ? Quote Link to comment Share on other sites More sharing options...
angel1987 Posted June 27, 2010 Author Share Posted June 27, 2010 Ok thanks but how do i display the result for this? It gives an error while displaying the value after processing the query and through the while loop. Quote Link to comment Share on other sites More sharing options...
Mchl Posted June 27, 2010 Share Posted June 27, 2010 What code you use for this and what error is displayed? Quote Link to comment Share on other sites More sharing options...
angel1987 Posted June 27, 2010 Author Share Posted June 27, 2010 It gave an unknown column error but i figured it out and its working now, thanks very much for your help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.