Wordpress wpdb

Note : Sebelumnya Anda harus mendeklarasikan
$wpdb
Get Result
$type = $wpdb->get_results( "SELECT post_type FROM $wpdb->posts WHERE ID=$id" );
Delete
$wpdb->query( "DELETE FROM $wpdb->options WHERE option_name = '$name'" );
Update
$wpdb->query( "UPDATE $wpdb->posts SET post_title = '$mytitle' WHERE ID = $myid" );
Insert
$wpdb->insert( $wpdb->posts, array( 'post_title' => $mytitle ) );

Posting Komentar

Lebih baru Lebih lama