sybase function for MS-SQL Server
| From: | jong jong | Date: | Thu, 28 Jun 2001 23:22:53 +0000 |
| Subject: | sybase function for MS-SQL Server | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-9960@lists.php.net to get a copy of this message | ||
Hi,
I am working on Unix(Solaris 2.8) with Apache 1.3 and
php4. I need to connect MS-SQL Server without ODBC. I
know there is an option that using freetds but I
haven't tried it yet.
Someone told me that sybase functions can work with
MS-SQL Server directly. So I called sybase_xxx()
instead of mssql_xxx(). I was surprised that most of
them really work! But the problem is that
sybase_query() seems only work for "select ..."
statement. When I tried to pass
"insert...","update..." or "delete...", this function
returned "false", but the database was actually
updated. And the following sybase_query() would always
return "false" even it is for "select...".
Here is an example:
$conn=mssql_connect("MS-SQL
Server","login","password"); //successful
sybase_select_db("db",$conn); //return true
$result=@sybase_query("select ...",$conn); //Great!
That's what I want.
sybase_free_result($result); //no problem so far
$result=@sybase_query("insert ...",$conn); //return
false, but I did insert a new record into SQL Server.
sybase_free_result($result); //successful
$result=@sybase_query("select...",$conn); //return
false, can't work with "select..." any more.
...
Anybody had same experience before? I will appriecate
any information from you.
Wen
__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/