database – Is it important to have integers inserted using %d rather than %s?
Is it important to have integers inserted using
%d rather than
I have a situation where there is a large number of fields and values. When database changes are made, it is difficult to match all the field types to the data format. It would be much easier to have them all be
%s, even integers, but I am not sure of the ramifications of that.
$data = array( 'field1' => $this->val1, 'field2' => $this->val2, 'field3' => $this->val3, <snip> 'field100' => $this->val4 ) $format = array( '%d', '%s', '%d', <snip> '%s'); $wpdb->insert( $db_example, $data, $format );
I know the
format option is optional, again, what are the possible ramifications of not using it at all?