i have 2 tables customers
and imap_emails
. customer
table contain emails of customers.
I am using PHP-IMAP to fetch email from email server and then saving to database table imap_emails
.
the imap_emails
table has 2 fields from
and to
and to
field contains comma separated values.
i need to fetch emails from first table and then search against to
and from
on imap_emails
.
First i thought about a LIKE
condition to search , but i would like to have something like FIND_IN_SET
or something other.
How can i achieve this in a better way ? ( For some reasons i cannot use relations on this table )
Please advice.