dbforge add_key - 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: dbforge add_key (/showthread.php?tid=5793) |
dbforge add_key - El Forum - 02-04-2008 [eluser]Eric Barnes[/eluser] I am trying to use the new dbforge to create a database. One issue that I can't seem to figure out is how to use the add_key to create a key on multiple fields. Through straight mysql I am creating a table like this: Code: $sSQL = "CREATE TABLE `".$prefix."article2cat` ( Through dbforge I have this: Code: $this->dbforge->add_field($fields); But I don't see a way of creating a key for two columns. dbforge add_key - El Forum - 02-11-2008 [eluser]Sean Murphy[/eluser] Does this work? Code: $this->dbforge->add_key('field_1, field_2'); dbforge add_key - El Forum - 02-11-2008 [eluser]Eric Barnes[/eluser] That sure does and I am not sure why I didn't think about it. Thank you very much. |