Using Database Class to perform updates, combining 2 tables - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Using Database Class to perform updates, combining 2 tables (/showthread.php?tid=47627) |
Using Database Class to perform updates, combining 2 tables - El Forum - 12-15-2011 [eluser]mallix[/eluser] Hello everybody, I have an sql query like this: Lets say we have 2 tables: a USER and a USER_PROFILE We want to update the USER_PROFILE table row: surname,name,city etc via USER id . Relationship is 1 USER row has 1 PROFILE row, so table USER has a profile_id in it. a normal query would be: Code: UPDATE user_profile Can we implement this using codeIgniter s database class? Updating 1 table s values when we have another s table known key and both tables are related. |