WordPress: select single row/value (wpdb)

How to select a single row/value with wpdb in WordPress:

$check = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM wp_posts WHERE id = '$postid' AND foobar = '1' ORDER BY ID DESC LIMIT 1" ), ARRAY_A );
//print_r ($check);
$time = $check["timestamp"];

Hinterlasse einen Kommentar

  Abonnieren  
Benachrichtige mich bei
Scroll to Top