mysql 连接orcal 数据库 OCIDefineByName
Oracle 8 資料庫函式庫
OCIDefineByName
讓 SELECT 指令可使用 PHP 變數。
語法: boolean OCIDefineByName(int stmt, string ColumnName, mixed &variable, int [type]);
傳回值: 布林值
函式種類: 資料庫功能
內容說明
本函式用來定義指定的 PHP 變數,使其能供 SQL 指令中的 SELECT 指令使用。在大小寫的問題上要注意一下,因為 Oracle 資料庫中的欄位名稱其實都是大寫的名字。參數 stmt 是經過 Oracle 解析 (OCIParse) 後的字串指標。參數 ColumnName 是 Oracle 資料表上的欄位名稱。參數 variable 前面一定要加 & 符號,表 PHP 變數位址。參數 type 通常省略。值得注意的是欲使用 Oracle 8 中特有的新資料型態 LOB/ROWID/BFILE 等時,需要先執行 OCINewDescriptor() 函式。執行本函式成功則傳回 true 值。
使用範例
這個範例是 thies@digicol.de 所提出的
<?php
$conn = OCILogon("scott","tiger");
$stmt = OCIParse($conn,"select empno, ename from emp");
/* 使用 OCIDefineByName 要在執行 OCIExecute 前 */
OCIDefineByName($stmt,"EMPNO",&$empno);
OCIDefineByName($stmt,"ENAME",&$ename);
OCIExecute($stmt);
while (OCIFetch($stmt)) {
echo "empno:".$empno."\n";
echo "ename:".$ename."\n";
}
OCIFreeStatement($stmt);
OCILogoff($conn);
?>
相关文档:
mysqld程序--目录和文件
basedir = path 使用给定目录作为根目录(安装目录)。
character-sets-dir = path 给出存放着字符集的目录。
datadir = path 从给定目录读取数据库文件。
pid-file = filename 为mysqld程序指定一个存放进程ID的文件(仅适用于UNIX/Linux系统); Init-V脚本需要使用这个文件里的进程ID结束mysqld进 ......
For our four-node, four-host MySQL Cluster, it is necessary to
write four configuration files, one per node host.
Each data node or SQL node requires a
my.cnf
file that provides two pieces of
information: a connectstring
that tells
......
To shut down the cluster, enter the following command in a shell
on the machine hosting the management node:
shell> ndb_mgm -e shutdown
The -e
option here is used to pass a command to
the ndb_mgm
client from the shell. (See
Section 4.23, “ ......
1.配置名字为myodbc的数据源
2.在stdafx.h中加上
#import "c:\program files\common files\system\ado\msado15.dll" no_namespace rename ("EOF", "adoEOF")
3.在程序初始化的方法中加上
AfxEnableControlContainer();
// 初始化COM,创建ADO连接等操作
AfxOleInit();
4.在合适的地方加上
public:_ConnectionPt ......