better way to do this.. ?

admin

Administrator
Staff member
i've got two tables

"sites" and "menus"

"site" table has this columns:
siteid, sitename, menuid

and the "menus" table has this columns:
menuid, name, contents

what i've got is sitename. if i want to know what are the names and contents from "menus" that sitename (from table "sites") is using i will do:

1st step: SELECT menuid FROM sites WHERE sitename='somesitename'
--> i retrieve menuid

2nd step: SELECT name, contents FROM menus WHERE menuid=retrieved_menuid
--> now i have names and contents


my question is, if there is any way to retrieve names and contents columns in one step and not two?

how? i tried some tablename.columnname etc etc, but without success. please please help me. i will really apretiate your help,

thank you very much!
 
Back
Top