我如何计算qho在一个带有php的mysql表中具有相同名称的项目,我试过这个但是他总是打印出唯一的第一个,但我有5个相同的Custumer名称..这是我的代码..
render() {
var seriesArr = getSeriesArr(this.props)
return(
<div>
<div className="row">
<ul>
{chartToRender(seriesArr)}
</ul>
</div>
</div>
)
}
答案 0 :(得分:0)
我认为您要查找的查询应如下所示:
select nbCliente, count(nbCliente) from pedidos where nbCliente = $Codigo group by nbCliente
答案 1 :(得分:-1)
$stmt= $con->prepare("SELECT COUNT(`id`) FROM $tablename WHERE $where ");
$stmt->execute();
$counttable = $stmt->fetchColumn();