我想用PHP SQL值返回到一个HTML表格。 我能得到的每一列没有问题,以填充除最后一列, "GROUP _ CONCAT (provision_id)."
相关的代码:
<?php
global $wpdb;
$wpdb->show_errors();
$contents = $wpdb->get_results( $wpdb->prepare("SELECT salaries.id, name, remaining, contract_value, GROUP_CONCAT( provision_id ) FROM salaries LEFT JOIN contracts ON contracts.id = salaries.id GROUP BY salaries.id"));
?>
[table header stuff...]
<?php
foreach ($contents as $content) {
?>
<tr>
<td><?php echo $content->name ?></td>
<td><?php echo $content->remaining ?></td>
<td><?php echo $content->contract_value ?></td>
<td><?php echo $content->GROUP_CONCAT(provision_id) ?></td>
<?php }; ?>
</tr>
只是呼应$content->provision-id
也不起作用。