# PHP 函数:solid\_connect()

**URL:** <https://www.isharkfly.com/t/php-solid-connect/4962>\
**Category:** PHP\
**Created:** [November 14, 2012, 7:47am UTC](https://www.isharkfly.com/t/php-solid-connect/4962 "2012-11-14T07:47:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [November 14, 2012, 7:47am UTC](https://www.isharkfly.com/t/php-solid-connect/4962/1 "2012-11-14T07:47:29Z")

</div>

链接至 solid 数据库。

语法: int solid\_connect(string dsn, string user, string password, int [cursor\_type]);

返回值: 整数

函数种类: 数据库功能

内容说明  
本函数用来链接到 solid 数据库，返回值为链接的代号 ID 值。参数 dsn 为资料来源名称 (Data Sources Name)。参数 user 及 password 分别为链接的帐号及密码。参数 cursor\_type 通常省略，其值有 SQL\_CUR\_USE\_IF\_NEEDED、SQL\_CUR\_USE\_ODBC、SQL\_CUR\_USE\_DRIVER 及 SQL\_CUR\_DEFAULT 等四种。当使用复杂的资料存取时可能会有类似 “Cannot open a cursor on a stored procedure that has anything other than a single select statement in it” 的错误信息字符串，此时若将参数 cursor\_type 的值设为 SQL\_CUR\_USE\_ODBC 就可以避开了。
