By bfbryan on
I am trying to show a table where I am would like to pull the user's name as well as category names. In the database both fields are called name. How do I pull that into my table? Do I need to run two queries? Do I need to somehow alias one of the fields?
Comments
(no title)
Prefix them with their table name:
SELECT user.name, category.name FROM user, category WHERE ......If you want you can alias them as well for convenience:
SELECT user.name u_name, category.name c_name FROM user, category WHERE ......Alias the tables
something like
SELECT a.name AS a_name, b.name AS b_name FROM table_a a, table_b bTry this
Nancy W.
Drupal Cookbook (for New Drupallers)
Adding Hidden Design or How To notes in your database
NancyDru
That worked great.
thanks