Jump to content


Photo

Need some data from other table instead


  • Please log in to reply
1 reply to this topic

#1 Yesideez

Yesideez
  • Members
  • PipPipPip
  • Advanced Member
  • 2,334 posts
  • LocationDevon, UK

Posted 22 August 2006 - 10:35 PM

I've got this query:
SELECT b.`inboxid`,a.`username`,b.`message` FROM users a, inbox2 b WHERE a.`userid`=b.`fromid` AND b.`fromid`='1' ORDER BY b.`inboxid` DESC
Which returns:
6,Yesideez,Sixth,,,,
5,Yesideez,Fifth
3,Yesideez,Third
2,Yesideez,Second
1,Yesideez,First

Problem is, instead of pulling my name from the users table (send TO) I need it to return the sent FROM from the users table. Is this possible or do I need to add another select query in my loop that gets the username from the users table?
Not a pro just an enthusiast :)

if (empty($coffee)) {$coffee=new coffee();}

Please surround any code using the CODE tags - I rarely look at anything without them

#2 fenway

fenway
  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 22 August 2006 - 11:38 PM

Huh?
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users