在php中获取结果的可能解决方法是什么
我一直致力于在wordpress中将用户数据库显示为一个表。使用get_results()我也可以获得所需的输出。但是,通过传递参数是否有任何解决方法呢。以下是我的作品:在php中获取结果的可能解决方法是什么,php,mysql,Php,Mysql,我一直致力于在wordpress中将用户数据库显示为一个表。使用get_results()我也可以获得所需的输出。但是,通过传递参数是否有任何解决方法呢。以下是我的作品: <?php get_header(); ?> <?php global $wpdb; $table_name = $wpdb->prefix .'users'; $row = $wpdb->get_results("select*from $table_name"); echo "<h
<?php
get_header(); ?>
<?php
global $wpdb;
$table_name = $wpdb->prefix .'users';
$row = $wpdb->get_results("select*from $table_name");
echo "<h2><center><u>List Of Members</u></center></h2>";
echo "<table class='table'>";
echo "<thead>
<tr>
<th><center>Member Name</center></th>
<th><center>Age</center></th>
<th><center>Class</center></th>
<th><center>Address</center></th>
</tr>
<thead>";
foreach ($row as $row)
{
$usid = $row->ID;
$username = $row->user_login;
echo "<tr><td>".$username."</td>";
$age=get_user_meta( $usid, 'age', true);
echo "<td>".$age."</td>";
$class=get_user_meta($usid, 'class', true);
echo "<td>".$class."</td>";
$address=get_user_meta($usid, 'address', true);
echo "<td>".$address."</td>";
}
?>
有。使用get_用户本文将帮助您get_用户需要在没有$wpdb的情况下运行;