Jump to content

bug or not?


langziyang

Recommended Posts

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...