How to use join 3 tables
Posted: Mon Nov 05, 2007 6:03 am
I want to send email to all members whenever a product is added. I also need to track the ids of the member_ids to whom mail's are successfully sent, so that if not sent again i should be able to send
for this sent table is used. Once all members gets mail, prod_flag will be set to 1
table structure
product
product_id
product_name
prod_flag
member
member_id
member_name
sent
product_id
member_id
I am trying to get all those member_ids and products whose flag=0 and not in sent table.
// struct here
how to get product ids which are not in sent table.
for this sent table is used. Once all members gets mail, prod_flag will be set to 1
table structure
product
product_id
product_name
prod_flag
member
member_id
member_name
sent
product_id
member_id
I am trying to get all those member_ids and products whose flag=0 and not in sent table.
Code: Select all
"SELECT * FROM members, product WHERE AND member_id NOT IN sent"how to get product ids which are not in sent table.