I also apologize if my question is painfully obvious to the rest of you but here we go:
I need to get information out of three tables in a single database.
Is it better to write different queries like this:
Code: Select all
$query1 = "SELECT * FROM LINEITM WHERE SO_NO=$id";
$query2 = "SELECT LINEITM.SO_NO, CUSTSHP.NAME, CUSTSHP.ADDRESS, FROM LINEITM, CUSTSHP WHERE LINEITM.SHIP_ID = CUSTSHP.SHIP_ID AND LINEITM.SO_NO=$id";
$query2 = "SELECT LINEITM.SO_NO, SOHEAD.ORDER_DATE, SOHEAD.REQRD_DATE, SOHEAD.PO_NO FROM LINEITM, SOHEAD WHERE LINEITM.SO_NO = SOHEAD.SO_NO AND LINEITM.SO_NO=$id";
I am new and this seemed like a logical way to do it but since it is slow I figure it is bad. If it is bad can you elaborate on why. I am trying to learn instead of just getting the code I need today.
Thanks for your input.