How to make information from 2 tables match based on record value
===

I'm doing this in PHP and MYSQL it's used in a an ordering system, an order comes in with a specific item, I have a look up table that has a unique number I'm trying to sort by, I need to figure out a way to say if the item ordered matches the item in the table copy the id over to the order table like follows


Look Up Table
#     item              ID
1    batman comic book  1111
2    superman comic     1112
3    spiderman comic    1113

Order table 
#          Ordered_item            Sort_ID
1          spiderman comic          NULL
2          batman comic book        NULL
3          superman comic           NULL

     $sort = "SELECT ordered_item, sort_id
		FROM order table 
		AND LOWER(payment_status) = 'completed' 
		AND address_name <> ''";
     $item_ids = "SELECT *
		FROM look up table";



    $rows = $db -> fetch_all_array($sort);
    $updaters = $db -> fetch_all_array($item_ids);
    $itemname = $updaters['item']; 
    $itemkey = $rows['sort_id'];
    $updatekey = $updaters['ID'];
    echo $updatekey;
    if ($itemkey = NULL)
     { if ($updaters['item'] == $rows['item_name'])
         $itemkeys = $updatekey;
    mysql_query("UPDATE `paypal_ipn_orders` SET `key` = '. $itemkeys .'");
    }


I want to update the order table Sort_ID to match the ID from the look up table. 

I figured I could use a nested if statement but Sort_ID just comes back 0

