Google
搜索www.dodoakn 搜索DoDoKan

函数:ifxus_close_slob()

ifxus_close_slob
删除 slob 类。
语法: boolean ifxus_close_slob(int bid);
返回值: 布尔值
函数种类: 数据库功能

内容说明

本函数用来删除 slob 类。参数 bid 为 slob 类代码。执行成功则返回 true 值,失败返回 false 值。

函数:ifx_update_char()

ifx_update_char
更改字符类。
语法: boolean ifx_update_char(int bid, string content);
返回值: 布尔值
函数种类: 数据库功能

内容说明

本函数用来更改字符 (char) 类。参数 bid 为字符的类代码。参数 content 为欲使用的新字符。执行成功则返回 true 值,失败返回 false 值。

函数:ifx_update_blob()

ifx_update_blob
更改长位类。
语法: boolean ifx_update_blob(int bid, string content);
返回值: 布尔值
函数种类: 数据库功能

内容说明

本函数用来更改长位 (blob) 类。参数 bid 为 blob 类代码。参数 content 为欲使用新的 blob 资料。执行成功则返回 true 值,失败返回 false 值。

函数:ifx_textasvarchar()

ifx_textasvarchar
配置文字模式默认值。
语法: boolean ifx_textasvarchar(int mode);
返回值: 布尔值
函数种类: 数据库功能

内容说明

本函数用来配置所有 select 的 SQL 指令用到的文字 (text) 类模式默认值。参数 mode 的值为 0 表返回 blob 的代码;1 表返回 varchar 字符串。执行成功则返回 true 值,失败返回 false 值。

函数:ifx_query()

ifx_query
送出一个 query 字符串。
语法: int ifx_query(string query, int [link_identifier], int [cursor_type], mixed [blobidarray]);
返回值: 整数
函数种类: 数据库功能

内容说明

本函数送出 query 字符串供 Informix 做相关的处理步骤。若没有指定 link_identifier 参数,则程序会自动寻找最近打开的 ID。参数 cursor_type 可省略,其值有 IFX_SCROLL 与 IFX_HOLD 二种。若有 BLOB 的字段要加在 query 指令之中,可使用 blobidarray 参数,指定 BLOB 的代码。

使用范例

例一:<?php
// 之前的程序省略
ifx_textasvarchar(1);      // 使用文字模式 (text mode) 的 blobs
$res_id = ifx_query(“select * from orders”, $conn_id);
if (! $res_id) {
  printf(“无法取出 orders 资料表 : %s\n<br>%s<br>\n”, ifx_error());
  ifx_errormsg();
  die;
}
ifx_htmltbl_result($res_id, “border=\”1\””);
ifx_free_result($res_id);
// 之后的程序省略
?>

例二:
<?php
// 之前的程序省略
//
// 为二进位及文字建立 BLOB 代码
$textid = ifx_create_blob(0, 0, “Text column in memory”);
$byteid = ifx_create_blob(1, 0, “Byte column in memory”); $blobidarray[] = $textid;
$blobidarray[] = $byteid;$query = “insert into catalog (stock_num, manu_code, ” .“cat_descr,cat_picture) values(1,’HRO’,?,?)”;
$res_id = ifx_query($query, $conn_id, $blobidarray);
if (! $res_id) {
  // 错误处理
}
ifx_free_result($res_id);
// 之后程序省略
?>