Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (!empty($errors)) {
- $status = ['status' => false, 'errors' => $errors];
- } else if (FALSE === $wpdb->insert('people', ['name' => $_POST['name']], '%s')) {
- $status = ['status' => false, 'errors' => ['Database error: ' . $wpdb->last_error]];
- } else {
- $status = ['status' => true];
- }
- echo json_encode( $status );
Advertisement
Add Comment
Please, Sign In to add comment