我试图从Magento数据库中选择数据并且它不起作用。我收到以下错误:
未捕获错误:调用成员函数get_var()
<?php
global $wpdb;
function jal_install() {
$table_name = $wpdb->prefix . "fees";
}
$results = $wpdb->get_var("SELECT service_fee FROM $table_name WHERE max >= $amount AND min = $amount");
echo $results['service_fee'];
?>