You are here: Comparing two mysql tables, please help! « PHP Programming Language « IT news, forums, messages
Comparing two mysql tables, please help!

Posted by Ian N on 09/26/05 19:52

I have a website which puts customers into different groups, depending
on the referrer they can see certain products. So for example if the
referrer code = 1, they'll only be able to see the products in group
1.

To achieve this I've used 2 database tables, one for all of the
products, and one for the groups (AGProds) which contains 2 colums
(GroupID and ProdID) the system works well and I've been happy with
it.

My problem is updating the products at the moment, they have to be done
one by one, what I'd really like is a page that displayed all the
products on one page, if the product was in the particular group, it
would put a tick in the tickbox, if not it would be left blank.

What I'm really struggling with is thinking of an efficient SQL call
to the 2 tables, I basically want to compare two tables, displaying all
of the products and flagging them if they're in another table.

Could someone help? Sorry for the long winded question.

Regards

Ian

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация