Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,255
Total Threads: 81,172
Total Posts: 566,877
There are 43 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

JOIN two queries using the 1st query results?

Thread title: JOIN two queries using the 1st query results?
     
    Thread tools Search this thread Display Modes  
Prev Previous Post   Next Post Next
09-21-2012, 11:24 PM
#11
Dan is offline Dan
Dan's Avatar
Status: Request a custom title
Join date: Feb 2005
Location:
Expertise:
Software:
 
Posts: 3,164
iTrader: 15 / 86%
 

Dan is an unknown quantity at this point

  Old

Nailed the code into a single query.

PHP Code:
SELECT `ft`.`slug`, `ft`.`titleFROM `forum topics` AS `ftWHERE `ft`.`themeIN(SELECT `t`.`idFROM `users themes` AS `utLEFT JOIN `themes` AS `tON `ut`.`themeid` = `t`.`idWHERE `ut`.`userid` = '{$user->id}'ORDER BY `ft`.`dateASC 

Reply With Quote
     


Thread Tools
Display Modes

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed