i am using redbeanphp for database manipulation. i create a table and add a row to my database using this code :
$bean= R::dispence("esate") ;
$bean->import(json_decode($data)) ;
R::store($bean);
in my $data variable i have null property such as address and when redbeanphp store this bean in database set this property type to tinyint or other type. now when i create another bean with address property my sql ignore my value and left address column null.
can redbean handle this problem and if answer is YES how ?
$bean = R::dispense('bean');
$bean->import(json_decode('{"address":null}'));
R::store($bean);
$bean = R::dispense('bean');
$bean->import(json_decode('{"address":"test"}'));
R::store($bean);
var_dump(R::getAll('SELECT * FROM bean'));
array(2) {
[0] =>
array(2) {
'id' =>
string(1) "1"
'address' =>
NULL
}
[1] =>
array(2) {
'id' =>
string(1) "2"
'address' =>
string(4) "test"
}
}