php - Best way to receive variables from database -
i have custom wordpress table following contents: account_info id | account_id | wp_title | wp_url 1 | 12345 | website | website.com what best (or fastest) way results? option 1: global $wpdb; $sql = "select id, wp_title. wp_name account_info"; $results = $wpdb->get_results($sql); if(!empty($results)) { foreach($results $r) { $id = $r->id; $wp_title = $r->wp_title; $wp_name = $r->wp_name; } } option 2: $id = $wpdb->get_var("select id account_info"); $wp_title = $wpdb->get_var("select wp_title account_info"); $wp_name = $wpdb->get_var("select wp_name account_info"); when talking "best" , "fastest" - these aren't things need take consideration. readibility key future developers looking @ code. option 1 shows that, if result set isn't empty, loop around them , set variables. option 2 framework specific , , isn't b...