GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   php innerjoin question (https://gfy.com/showthread.php?t=1136627)

mkx 03-23-2014 06:07 PM

php innerjoin question
 
I have 3 mysql tables

table1 =
orderid,shippingmethod

table2 =
transactionid,orderid

table3 =
transactionid,shipmethod2

I want to update all of table 1's shippingmethod to show the shipmethod2 from table 3

Can anyone post the code to do this? I am getting a bit confused

sarettah 03-23-2014 08:11 PM

Quote:

Originally Posted by mkx (Post 20024885)
I have 3 mysql tables

table1 =
orderid,shippingmethod

table2 =
transactionid,orderid

table3 =
transactionid,shipmethod2

I want to update all of table 1's shippingmethod to show the shipmethod2 from table 3

Can anyone post the code to do this? I am getting a bit confused

update table_1 a inner join table_2 b on a.orderid=b.orderid inner join table_3 c on b.transactionid=c.transactionid set a.shippingmethod=c.shipmethod2

Should do it.

.

mkx 03-24-2014 12:49 PM

thanks ill give that a whirl


All times are GMT -7. The time now is 03:27 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123