栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > PHP > PHP函数库

PHP - 函数:ifx_query()

PHP函数库 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

PHP - 函数:ifx_query()

Informix 数据库函数库
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 资料表 : %sn 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);
// 之后程序省略
?


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/1694.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号