Jump to content


set_relation_n_n not saving to db

set_relation_n_n database

  • Please log in to reply
4 replies to this topic

#1 threestatedrive

threestatedrive

    Member

  • Members
  • PipPip
  • 20 posts

Posted 11 January 2013 - 06:41 PM

i have done this successfully in another instance, but for some reason, this isnt saving to the db

i have a table Cases
case_id
case_title

a table Posts
post_id
post_title

and my relational table is case_post
case_id
post_id
priority

In my Case controller, i want to be able to relate multiple posts, so my controller code line is:
$this->grocery_crud->set_relation_n_n('posts', 'case_post', 'posts', 'case_id', 'post_id', 'post_title','priority');

it displays no problem in my edit page, but when i try and save, it doesnt...
i'm really struggling to see why
on my post controller, i am able to do it with a post_cat relational table, and even in the Case controller, if i utilize the post_cat code, it saves.. just not this table.. I've even tried rebuilding the table, but to no avail..
anyone seen this before?

#2 goFrendiAsgard

goFrendiAsgard

    Advanced Member

  • Members
  • PipPipPip
  • 137 posts

Posted 20 January 2013 - 03:52 PM

Have you check the field types of each table's fields?

No-CMS homepage : http://www.getnocms.com
No-CMS forum : http://www.getnocms.com/forum
No-CMS Github page : https://github.com/g...diAsgard/No-CMS

 

Please don't mix up No-CMS and groceryCRUD issues.
(eg: user authentication etc is No-CMS specific issue and has nothing to do with groceryCRUD)

 


#3 threestatedrive

threestatedrive

    Member

  • Members
  • PipPip
  • 20 posts

Posted 21 January 2013 - 01:10 PM

i got it sorted thanks!
ugh. i had overlooked that i didnt have the field included

#4 tim8917

tim8917

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 11 February 2014 - 03:23 PM

i got it sorted thanks!
ugh. i had overlooked that i didnt have the field included

Could you explain what helped you? I've the same problem: in one case set_relation_n_n works fine, in another case with similar conditions it fails.



#5 voghDev

voghDev

    Member

  • Members
  • PipPip
  • 20 posts

Posted 30 March 2015 - 01:20 PM

I'm having exactly the same issue; Saved when editing, but not when adding rows.

 

Similar topics:

 

http://www.grocerycr...a-n-n-relation/

 

http://www.grocerycr...-no-save-en-bd/

 

Could you please give details about how you solved it? Seems like plenty developers are having the same issue. 

 

Thanks in advance.







Also tagged with one or more of these keywords: set_relation_n_n, database

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users