Skip to main content
deleted 3 characters in body
Source Link
Edward
  • 439
  • 3
  • 17

So I do validation when saving data to database like following:

$data = validate($data);
update_post_meta($post_id, 'my_post_meta', $data);

The question is, do I need to do validation again when read the data from database?

$data = get_post_meta($post_id, 'my_post_meta');
$data = validate($data); // Do validation again?

So I do validation when saving data to database:

$data = validate($data);
update_post_meta($post_id, 'my_post_meta', $data);

The question is, do I need to do validation again when read the data from database?

$data = get_post_meta($post_id, 'my_post_meta');
$data = validate($data); // Do validation again?

I do validation when saving data to database like following:

$data = validate($data);
update_post_meta($post_id, 'my_post_meta', $data);

The question is, do I need to do validation again when read the data from database?

$data = get_post_meta($post_id, 'my_post_meta');
$data = validate($data); // Do validation again?
Source Link
Edward
  • 439
  • 3
  • 17

Is it necessary to do validation again when retrieving data from database?

So I do validation when saving data to database:

$data = validate($data);
update_post_meta($post_id, 'my_post_meta', $data);

The question is, do I need to do validation again when read the data from database?

$data = get_post_meta($post_id, 'my_post_meta');
$data = validate($data); // Do validation again?