V
V
Valery Khizhevsky2018-04-10 15:00:54
MySQL
Valery Khizhevsky, 2018-04-10 15:00:54

How to pull out the same name value from two different tables and operate with it?

Good day.
There are two different tables "Purchases" and "Sales", they have the same column, you need to take its values ​​and manipulate it, how can this be done?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
iljaGolubev, 2018-04-10
@Roshette

// Если созданы модели
$sales = Sales::find(1);
$purchases = Purchases:find(1);
$sales_column = $sales->any_column;
$purchases_column =  = $purchases->any_column; 

manipulation($sales_column , purchases_column );

$sales->update();
$purchases->update();
Everything is here: database , eloquent

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question