I have 3 mysql tables containing a few fields. Please refer to the following
-------- -------- --------
table 1 | table 2 | table 3
-------- -------- --------
a_id | b_id | email
| a_id
name | status | b_id
email_1 | date | name
phone | ref | phone
address | email_2 | address
state | from | state
| status
| date
| ref
| from
The email_1 and email_2 is exactly same.
I need to populate the table3 fields with all table1 and table2 data. But I need to store them in one row based on email. So they look like following:
=================================================================================
table 3
=================================================================================
email | a_id | b_id | name | phone | address | state | status | date | ref | from
------+------+------+------+-------+---------+-------+--------+------+-----+-----
a@x.co| 9 | 112 | John | 999 | xxxx | NY | 0 | 15Jue| dave| y
------+------+------+------+-------+---------+-------+--------+------+-----+-----
b@x.co| 6 | 338 | Sue | 909 | xxxx | NY | 1 | 12Jue| kell| z
------+------+------+------+-------+---------+-------+--------+------+-----+-----
c@x.co| 3 | 152 | John | 679 | xxxx | NY | 1 | 10Jue| lois| g
------+------+------+------+-------+---------+-------+--------+------+-----+-----
d@x.co| 8 | 145 | John | 599 | xxxx | NY | 0 | 8Jue | sue | f
I can't figure it out how to do that. I'm using core php, mysql. Any help please?
Thanks!