W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
(PECL CUBRID >= 8.3.0)
cubrid_fetch_assoc — 返回與提取的行相對應的關聯(lián)數(shù)組
cubrid_fetch_assoc(resource $result, int $type = ?): array
此函數(shù)返回關聯(lián)數(shù)組,該數(shù)組對應于 fetched 行,然后將內部數(shù)據(jù)指針向前移動,或返回 當?shù)竭_終點時為 FALSE。
result
result
來自對 cubrid_execute() 的調用
type
Type 只能CUBRID_LOB,將使用此參數(shù) 僅當您需要操作 LOB 對象時。
關聯(lián)數(shù)組,當進程成功時。
false,當沒有更多行時;NULL,當進程不成功時。
示例 #1 cubrid_fetch_assoc() example
<?php
$conn = cubrid_connect("localhost", 33000, "demodb");
$req = cubrid_execute($conn, "SELECT name,area,seats,address FROM stadium WHERE nation_code='GRE' AND seats > 10000");
printf("%-40s %-10s %-6s %-20s\n", "name", "area", "seats", "address");
while ($row = cubrid_fetch_assoc($req)) {
printf("%-40s %-10s %-6s %-20s\n",
$row["name"], $row["area"], $row["seats"], $row["address"]);
}
// if you want to operate LOB object, you can use cubrid_fetch_assoc($req, CUBRID_LOB)
cubrid_close_request($req);
cubrid_disconnect($conn);
?>
以上示例會輸出:
name area seats address Panathinaiko Stadium 86300.00 50000 Athens, Greece Olympic Stadium 54700.00 13000 Athens, Greece Olympic Indoor Hall 34100.00 18800 Athens, Greece Olympic Hall 52400.00 21000 Athens, Greece Olympic Aquatic Centre 42500.00 11500 Athens, Greece Markopoulo Olympic Equestrian Centre 64000.00 15000 Markopoulo, Athens, Greece Faliro Coastal Zone Olympic Complex 34650.00 12171 Faliro, Athens, Greece Athens Olympic Stadium 120400.00 71030 Maroussi, Athens, Greece Ano Liossia 34000.00 12000 Ano Liosia, Athens, Greece
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: