Re: [PHP-DB] SELECT query from two tables

[email protected] (Chris)
Newsgroups php.db
Message-ID <[email protected]>

> ministry_directory_listing_categories.ministry_directory_category_reference = 10 AND
 > 
ministry_directory_listing_categories.ministry_directory_category_reference 
= 11

Can a record really have a reference for two different id's like this? 
ie can it be both '10' and '11' at the same time?

What's actually in the table for ministry_directory_listing_categories 
for this record?


For long table names, I'd also suggest using a table alias to make it 
easier to read/write:

select * from table1 as a inner join table2 as b using(id)
where a.field_name='1' and b.fieldname='5';

saves you having to write out 'ministry_directory_listing_categories' 
and 'ministry_directory'.

-- 
Postgresql & php tutorials
http://www.designmagick.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.