PHP 函数:ifx_htmltbl_result()

将 query 返回资料转成 HTML 表格。

语法: int ifx_htmltbl_result(int result_id, string [html_table_options]);

返回值: 整数

函数种类: 数据库功能

内容说明

本函数用来将 query 查询结果格式化成 HTML 标记格式的表格形式。参数 html_table_options 可省略,为 标记中的参数选项。成功则返回列数,失败则返回 false 值。

使用范例

以下的范例中,

标记的参数设表格边宽为 2。

<?php $rid = ifx_prepare("select * from emp where name like ".$name, $connid, IFX_SCROLL); if (! $rid) { // 错误处理 } $rowcount = ifx_affected_rows($rid); if ($rowcount > 1000) { printf ("返回资料太多,共 %d 笔\n
", $rowcount); die ("请重新执行 SQL 指令
\n"); } if (! ifx_do($rid) { // 错误处理 } ifx_htmltbl_result($rid, "border=\"2\""); ifx_free_result($rid); ?>