Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Insert problem: Cardinality violation: 1241 Operand should contain 1 column(s) with query
  • This query returns error "Cardinality violation: 1241 Operand should contain 1 column(s) with query: ". Any idea why? http://pastie.org/3664904 I also get this during update sometimes: http://pastie.org/3664919 I use standard ORM for insertion:
      $article = Model_Article::forge(array(
       'category_id' => Input::post('category_id'),
       'user_id' => $user->id,
       'author' => Input::post('author'),
       'status' => Input::post('status'),
       'allow_comments' => Input::post('allow_comments'),
       'title' => Input::post('title'),
       'summary' => Input::post('summary'),
       'body' => Input::post('body'), 
       'videos' => $videos,
       'tags' => Input::post('tags'),
       'uri' => Model_Article::_create_article_uri(Input::post('title')),
       'gallery_id' = $gallery->id,
       'view_count' => 0,
       'published_at' => strtotime(Input::post('published_at')),
      ));
    
      $article->save();
    

    Thanks!
  • Check the author value in your update-error example: it's gets an array passed to it, which the QB translates into '(value, value, etc)' but is not allwed by SQL. You need to make sure that field does not get passed an array.
  • Ah how I couldn't see that! Sorry for posting this and thanks for seeing it!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion