I have 2 tables both the table have exact same field names and datatype.
ISSUES: 1) I'm unable to receive data from both columns 2) I also need to count phone no in both table
The field names are member_id, name , phone
`SAMPLE DATA IN MEMBER TABLE`
------------------------------
member_id | name | phone |
------------------------------
100000 | ABC | 9876543210 |
-----------------------------*
`NOW SAMPLE DATA IN MEMBER_TEMP TABLE`
------------------------------
member_id | name | phone |
------------------------------
100001 | DEF | 9876543210 |
-----------------------------*
`NOW EXPECTED RESULTS/ OUTPUT EXPECTED`
------------------------------
member_id | name | phone |
------------------------------
100000 | ABC | 9876543210 |
------------------------------
100001 | DEF | 9876543210 |
-----------------------------*
BELOW IS LARAVEL QUERY BUILDER
$member_info = DB::table('member')->select('member_temp.*','member.*')->where(
array(
)
);
$member_info = $member_info->join('member_temp','member_temp.phone', '=', 'member.phone')
->get()->toArray();
//RAW MYSQL QUERY
select *
from `member`
inner join `member_temp`
on `member_temp`.`phone` = `member`.`phone`
THANKS IN ADVANCE
result OR Countof matching phone number from both table. When i run the query i get only one result from a particular table