Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $datos = array(
- 'title' => 'Tarifa EP Vista montaña',
- 'tipo' => 'EP',
- 'description' => $_POST['description'],
- 'precios' => $_POST['precio']
- );
- $format = array(
- '%s', '%s', '%s', '%d'
- );
- if ( !$post->ID ) {
- // insertar
- $wpdb->insert($wpdb->tarifas, $datos, $format);
- } else {
- $where = array(
- 'id' => $post->ID
- );
- // actualizar
- $wpdb->update($wpdb->tarifas, $datos, $where, $format, '%d');
- }
- // eliminar
- $wpdb->query("DELETE FROM {$wpdb->tarifas} WHERE id = $id");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement