dbforge - can only be one auto column and it must be defined as a key |
Hi guys,
Just wondering if you could assist with an error I'm seeing. The code: PHP Code: $this->dbforge->add_field('post_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT'); The error: Quote:Incorrect table definition; there can be only one auto column and it must be defined as a key It looks to be like the primary key element isn't being added to the query. Do you have any suggestions? Thanks!
Try to use an array as a parameter with the add_field method.
And check the userguide: http://www.codeigniter.com/user_guide/da...ing-fields Quote:Passing raw strings as fields cannot be followed by add_key() calls on those fields. (10-31-2015, 08:56 PM)orionstar Wrote: Try to use an array as a parameter with the add_field method. Bah, I read the userguide but missed that large Note box haha. Did try passing an array before I posted the thread but it gave the same result. Turns out the document wasn't uploading when I was saving it... your suggestion worked now that I have the ftp working again. Cheers! |
Welcome Guest, Not a member yet? Register Sign In |