最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - get_results() doesn't fetch the result

programmeradmin0浏览0评论

I am trying to fetch offer_price from my Database table but it is not showing any error, just shows a blank screen.

if ( $make=="1" && $model=="MDX" && $year>="2001" && $year<="2004" ) {

    global $wpdb;
    $results = $wpdb->get_results(
        "SELECT `offer_price` FROM wp_cost_estimation WHERE make='Acura' AND model_name='MDX' AND year_from>='2001' AND year_to<='2004'");

    foreach ($results as $result) {
        echo $result->offer_price;
    }  

} else{
    echo "try something else";
}

my desire result is offer_price=300

发布评论

评论列表(0)

  1. 暂无评论