php - Combine queries to grab foreign key value from different able based on result in mssql -


I have to work with an mssql database on which I have no control, very sad, Can not change all. This database is setup so that 2 tables are entry and area . In the field table, there is a column sArea , which I need to look at by the value ixEntry I Entry In the table, I can do a look up (variables are PHP variables):

  Enter from SELECTle, ixCategory, ixArea WHERE ixEntry = '$ ixEntry'  

and then do another query

  from the field SELECT sArea WHERE ixArea = '{$ return [' ixArea ']}'  

Which Apart from the way in which network setup is done, there are two questions. With much higher overhead time.

How can I add these two questions so that I have a result which is equal to SELECT sTitle, ixCategory, from entry WHERE ixEntry = '$ ixEntry' as if sArea were in the entry table, not ixArea?

  select from e.ixArea = a.ixArea at the entry area on the Join Area A. SArea WHERE e.ixEntry = '$ ixEntry'  

Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -