我创建简单的插件工作,它在主网页的工作,但是当我创建一个链接到用户去为见informaation的另一页,它告诉我致命错误:未捕获的错误:调用一个成员函数get_results()
我的代码是:
<?php
global $wpdb;
$results = $wpdb->get_results("SELECT * FROM wp_customers");
?>
<body>
<table>
<tr>
<th>ID</th>
<th>Name</th>
<th>Family</th>
<th>Numbers</th>
<th>Tell</th>
</tr>
<?php foreach($results as $results){
?>
<tr>
<td>
<?php echo $results->id; ?>
</td>
<td>
<?php echo $results->name; ?>
</td>
<td>
<?php echo $results->family; ?>
</td>
<td>
<?php echo $results->numbers; ?>
</td>
<td>
<?php echo $results->tell; ?>
</td>
<?php }?>
</tr>
</table>
您是否已将数据库前缀设置为“wp_”以外的内容? –