langziyang Posted July 16, 2019 Share Posted July 16, 2019 if i have own ObjectModule; fields and data is fields_id, fields_a, fields_b, fields_c, primary id is fields 1 11 11 11 2 22 22 22 now do this: $object=new OwnObject(); $object->id=2; $object->fields_b='222'; $object->save(); when exec save() function; fields_a and flelds_c will be 0 Link to comment Share on other sites More sharing options...
joseantgv Posted July 16, 2019 Share Posted July 16, 2019 (edited) You meant: $object=new OwnObject(2); $object->fields_b='222'; $object->save(); Edited July 16, 2019 by joseantgv (see edit history) Link to comment Share on other sites More sharing options...
langziyang Posted July 16, 2019 Author Share Posted July 16, 2019 3 minutes ago, joseantgv said: You meant: $object=new OwnObject(2); $object->fields_b='222'; $object->save(); no, new OwnObject(primaryid) will be ok. i sure is $object = new OwnObject(); $object->id=primaryid; object->save(); Link to comment Share on other sites More sharing options...
vividusdesigns Posted July 16, 2019 Share Posted July 16, 2019 Hi, I do not think it is a bug if the you are not passing values to fields_a and flelds_c and if they are not null and you have not set any default value in database the result will be always zero. If you do not want to save anything in those field mark them as NULL in database than nothing will be saved in those fields. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now