|
$wpdb->get_var( 'query' );
$wpdb->get_var( 'query', column_offset, row_offset ); |
|
Ex: $user_count = $wpdb->get_var( "SELECT COUNT(*) FROM $wpdb->users" );
|
|
$wpdb->get_row('query', output_type, row_offset);
|
|
OBJECT - result will be output as an object.
ARRAY_A - result will be output as an associative array ARRAY_N - result will be output as a numerically indexed array. |
|
$wpdb->get_col( 'query', column_offset );
|
|
$wpdb->get_results( 'query', output_type );
|
|
OBJECT - result will be output as a numerically indexed array of row objects.
OBJECT_K - result will be output as an associative array of row objects, using first column's values as keys (duplicates will be discarded). ARRAY_A - result will be output as a numerically indexed array of associative arrays, using column names as keys. ARRAY_N - result will be output as a numerically indexed array of numerically indexed arrays. |
|
$wpdb->insert( $table, $data, $format );
|
|
$wpdb->replace( $table, $data, $format );
|
|
$wpdb->update( $table, $data, $where, $format = null, $where_format = null );
|
|
$wpdb->delete( $table, $where, $where_format = null );
|
|
$wpdb->query('query');
|
|
$sql = $wpdb->prepare( 'query' , value_parameter[, value_parameter ... ] );
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.