[PHP-DB] regarding the handling of resource types in PHP Extensions

[email protected] ("H Thirividi")
Newsgroups php.db
Message-ID <[email protected]>
Hi All,

I am involved in writing a mapper extension wherein I take a api of mysql
extension like mysql_connect() and map it to db2_connect() and
then connect to the database and return the connection handle to the
script(.php file). The *problem involved* is with the *resource types*. In
the connection handle structure of my extension there is a field which is
the *pointer* to the *db2 connection handle*(conn_handle *connection).After
I establish the connection to the database and then use the *connection
handle* to *close* the connection to the database, I face problems.In the
connection handle of my extension I have fileds like
database,username,password etc which I am able to *access properly* but when
I try to access the *db2 connection handle* fields through the
*pointer*present in my connection handle structure (conn_handle
*connection) I get
segmentation fault. Is it that the an extension cannot return values(a
resource type in my case) to another extension. Please do suggest what wrong
I am doing.


With Regards,
Harsha
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.