WordPress exposes an instance of a class named $wpdb that lets you access any table within your blog database. The following example gets a row from the users table and print the result as an associative array.
1 2 3 4 |
<?php $user_info = $wpdb->get_row("SELECT * FROM $wpdb->users WHERE id = 1", 'ARRAY_A'); print_r($user_info); ?> |