php innerjoin question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mkx
    Confirmed User
    • Nov 2003
    • 4001

    #1

    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
    see you later, I'm gone
    • Oct 2002
    • 14297

    #2
    Originally posted by mkx
    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.

    .
    All cookies cleared!

    Comment

    • mkx
      Confirmed User
      • Nov 2003
      • 4001

      #3
      thanks ill give that a whirl

      Comment

      Working...