Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not create row with only one column "id" #114

Open
dejwid opened this issue Mar 19, 2015 · 2 comments
Open

Can not create row with only one column "id" #114

dejwid opened this issue Mar 19, 2015 · 2 comments

Comments

@dejwid
Copy link

dejwid commented Mar 19, 2015

I have a table with only one column - id.
When I create object and then save them - the following error is occurring:

SQLSTATE[HY000]: General error: 1 near ")": syntax error [ INSERT INTO `attribute_collections` () VALUES ()

I think, that kohana orm does not support to insert record with only 1 column (and this one is primary key).
I think it should be fixed.

@jimktrains
Copy link
Contributor

How did you set the values? If I remember, ->values($array) will not set the primary key unless you tell it to, e.g. ->values($array, array('id')).

@Hejprint
Copy link

👍 I had also problem to do this, so finally created extra column with just single '1' as a value on each record. I know its bad solution but it was working :)

@jimktrains

$object = new Model_Test;
$object->save();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants