wordpress - How do I get one cell value from $wpdb? -
wordpress - How do I get one cell value from $wpdb? -
i can't figure out function should use, get_var, get_results or may shouldn't utilize them @ all, neet echo 1 value 1 cell only, 9000.
<?php $apartprice_this = $wpdb->get_results( $wpdb->prepare("select meta_value wp_postmeta post_id=%d , meta_key=%s", the_id(),'price')); echo $apartprice_this; ?>
but now, don't know takes, returns me "8array", that?
wp function get_results returns array. echo value in array should utilize field key as:
foreach( $apartprice_this $results ) { echo $results->field_key; }
wordpress wordpress-plugin wpdb
Comments
Post a Comment