以下为引用的内容: <? function openConn(){ //打开数据库连接 //ODBC: //$conn=odbc_connect("dsn","uid","pwd"); //OCI 函数 $conn=ocilogon("chat","chat"); return $conn; } function openSql($conn,$sql){ //执行 sql 语句 //ODBC //$stmt=odbc_exec($conn,$sql); //OCI $stmt=ociparse($conn,$sql); ociexecute($stmt); return $stmt; } function GetColumn($stmt,$colname){ //odbc //$ret=odbc_result($stmt,$colname); //OCI $ret=ociresult($stmt,$colname); return $ret; } function FecthRow($stmt){ //ODBC //$ret=odbc_fetch_row($stmt); //OCI $ret=ocifetch($stmt); return $ret; } ?> |
以下为引用的内容: <? $conn=openconn(); $stmt=opensql($conn,$sql); fetchrow($stmt); echo getcolumn($stmt,"COLUMNNAME"); ?> |