Updating a table when using LEFT JOIN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi there everyone,

 

I am using the following to grab the data I need from several tables:

 

$sql = "SELECT * FROM vendorprices LEFT JOIN fooditems on
(vendorprices.FoodItemNumber = fooditems.FoodItemID) WHERE
vendorprices.VendorNumber='$VendorID' ORDER BY
vendorprices.VendorItemNumber";

 

This works great, very fast etc .. the problem is, I then need to give the
option for them to edit the items - again, not a problem in populating the
form - until I have to then use the UPDATE function, how can I update each
item in separate tables when I use the above join to grab the info in the
first place?  I've never had to write to 2 tables at once where data is
relative like this, infact it was my first time of using JOINS at all to
even display the data.

 

I'm using PHP with MySQL.

 

Thank you.

 

Chris


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux