您的位置:首页 >> Web开发 >> CGI技术 >> 正文
CGI技术 RSS
 

关于odbc的一个文挡说明,奉献给大家

http://www.rdxx.com 06年04月21日 07:27 网海之贝 我要投稿

关键词: 说明 , ODBC

}
if ($db->Sql("Select * FROM foo")){
    $db->DumpError;
}

Back to the top  

DumpData
Dump to the screen all field names and the data in all rows of the current dataset. This is used primarily for debugging.
Example:
$db->Sql("Select * FROM foo");
$db->DumpData;

Back to the top  

Error
Returns the last recorded error in the form of an array or string (depending upon the context) containing the error number, error text and the ODBC connection that caused the error (if there is one).
Example:
die $db->Error(), qq(\n);

($ErrNum, $ErrText, $ErrConn) = $db->Error();

Back to the top  

FetchRow
Fetches the next row of data from the previous specified SQL statement. You would then call Data or DataHash to actually retrieve the individual elements of data. Returns undef if there's an error, TRUE otherwise.
Example:
$db->Sql("SELECT * FROM foo");
$db->FetchRow() || die qq(Fetch error: ), $db->Error(), qq(\n);
$f1 = $db->Data("f1");
See also: Sql, Data, DataHash

Back to the top  

FieldNames
Returns a list of field names extracted from the current dataset. This is used mostly for testing/debugging. FieldNames returns the data in an array, with no guarantee of the order of the names.
Example:
$db->Sql("SELECT * FROM foo");
$db->FetchRow();
foreach $fd ($db->FieldNames()) print qq($fd: "), $db->Data($fd), qq("\n);

Back to the top  

GetConnections
Returns an array of connection numbers for all objects.
Example:
@cnums = $db->GetConnections;

Back to the top  

GetDSN
GetDSN conn
Returns the DSN (Data Source Name) or the ODBCDriverConnect string for the connection conn, or the current connection if not specified.
Example:
print LOG qq(Current connection: "), $db->GetDSN, qq("\n);

Back to the top  

GetMaxBufSize
Returns the current maximum single field data size, in bytes.
Example:
$max = $db->GetMaxBufSize;
$db->SetMaxBufSize($needed) if ($max < $needed);
See also: SetMaxBufSize
9 7 3 1 2 3 4 5 6 4 8 :

 
 
标签: 说明 , ODBC 打印本文
 
 
  热点搜索
 
 
 



Valid XHTML 1.0 Transitional
Copyright ©2005 - 2008 Rdxx.Com,All Rights Reserved
收藏本页
收藏本站