【发布时间】:2017-01-07 21:32:36
【问题描述】:
我想获取“till.code”值并使用增量数字索引数组保存它们。 这个想法是我可以用“$array[$variable],$array[$variable]..etc”打印这些值。变量应该是数字,1,2,3..
$stmt2=$dbh->prepare("SELECT till.code,shop.description Collate Cyrillic_General_CI_AI as description, count(tra.id) as servicios,ROUND(sum(tra.total_amount),1) as facturacion
FROM [TCPOS4].[dbo].[transactions] as tra, [TCPOS4].[dbo].[tills] as till,[TCPOS4].[dbo].[shops] as shop where tra.till_id=till.id and shop.id=till.shop_id and convert(date,tra.trans_date) = '$name2' and '$usuari'=CAST(LEFT(shop.code,5) AS INT) group by till.code,shop.description order by code;");
$stmt2->execute();
while ($row = $stmt2->fetch()) {
**I have to fill this.**
}
【问题讨论】:
标签: php arrays loops indexing fetch