Upload
keith-levi-lumanog
View
110
Download
1
Tags:
Embed Size (px)
DESCRIPTION
Wordpress database
Citation preview
WHY WOULD I USE WPDB?
1. custom database queries2. when using a plugin3. simplifying and optimizing server loads
Tuesday, October 8, 13
WHY WOULD I USE WPDB?
1. custom database queries2. when using a plugin3. simplifying and optimizing server loads4. it’s easy to maintain and flexible
Tuesday, October 8, 13
WHY WOULD I USE WPDB?
1. custom database queries2. when using a plugin3. simplifying and optimizing server loads4. it’s easy to maintain and flexible5. makes you a better WP developer
Tuesday, October 8, 13
WORDPRESS DATABASEWORDPRESS DATABASE CLASS - WPDB
C
R
U
D
reate
read
pdate
elete
Tuesday, October 8, 13
CREATE$wpdb->insert( ! 'table', ! array( ! ! 'column1' => 'value1', ! ! 'column2' => 123 ! ), ! array( ! ! '%s', ! ! '%d' ! ) );
Tuesday, October 8, 13
READ$mypost = $wpdb->get_row("SELECT * FROM $wpdb->posts WHERE ID = 10");
echo $mypost->post_title;
Tuesday, October 8, 13
DELETE
// Default usage.$wpdb->delete( 'table', array( 'ID' => 1 ) );
// Using where formatting.$wpdb->delete( 'table', array( 'ID' => 1 ), array( '%d' ) );
Tuesday, October 8, 13
QUESTIONS?Feel free to ask anything regarding WordPress or web
development in general.
Tuesday, October 8, 13