Fix DB IO write array method
Data was not written correctly in connection with boolean field types as the "has default" was used as if a default value, but it is just a flag IF it has a default value
This commit is contained in:
@@ -89,13 +89,14 @@
|
||||
# db write class test
|
||||
$table = 'foo';
|
||||
$primary_key = ''; # unset
|
||||
$db_write_table = array ('test');
|
||||
$db_write_table = array ('test', 'some_bool');
|
||||
// $db_write_table = array ('test');
|
||||
$object_fields_not_touch = array ();
|
||||
$object_fields_not_update = array ();
|
||||
$data = array ('test' => 'SOMETHING '.time());
|
||||
$data = array ('test' => 'BOOL TEST SOMETHING '.time());
|
||||
$primary_key = $basic->db_write_data_ext($db_write_table, $primary_key, $table, $object_fields_not_touch, $object_fields_not_update, $data);
|
||||
print "Wrote to DB tabel $table and got primary key $primary_key<br>";
|
||||
$data = array ('test' => '');
|
||||
$data = array ('test' => 'BOOL TEST OFF '.time(), 'some_bool' => 1);
|
||||
$primary_key = $basic->db_write_data_ext($db_write_table, $primary_key, $table, $object_fields_not_touch, $object_fields_not_update, $data);
|
||||
print "Wrote to DB tabel $table and got primary key $primary_key<br>";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user