Skip to Content.
Sympa Menu

freetds - sql server 7 problem - php

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Rick Gigger" <rick AT alpinenetworking.com>
  • To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
  • Subject: sql server 7 problem - php
  • Date: Wed, 21 Mar 2001 20:00:42 -0800


I am trying to connect to sqlserver 7 from linux/php.

I am using redhat 7, php 4.0.4pl1, sql server 7, freetds 0.51

I am trying to connect like this

$mssqlcon = mssql_pconnect("the_ip_of_the_sqlserver", "myusername",
"mypassword");

mssql_select_db("database_i_want_to_use", $mssqlcon);

but all I get is

Warning: 0 is not a Sybase link index in path/to/scrip/file.php on line 52

It doesn't report any errors during the connect step. But it apparently
doesn't connect because when you try to do anything with the link it returns
it dies.

Has anyone else had this problem.

Rick Gigger


-----Original Message-----
From: bounce-freetds-128533 AT franklin.oit.unc.edu
[mailto:bounce-freetds-128533 AT franklin.oit.unc.edu]On Behalf Of Gerry
Sent: Wednesday, March 21, 2001 3:35 PM
To: TDS Development Group
Subject: [freetds] OT: easy? dblib question


I'm not too fluent with dblib or SQL Server so I was wondering if
someone here might be able to help me out. I want to get the value
returned by a stored procedure and can't figure out how to do it. Here
is my attempt (which results in a segmentation fault at dbbind):

dbcmd(dbproc, "DECLARE @return_status FLOAT");
dbsqlexec(dbproc);

sprintf(sqlstr, "EXEC @return_status=sp_SendOrderToWMS
@intInternalOrderId=%d", (int) orderid);

dbcmd(dbproc, sqlstr);
dbsqlexec(dbproc);

dbcmd(dbproc, "SELECT @return_status");
dbsqlexec(dbproc);
while ((return_code = dbresults(dbproc)) != NO_MORE_RESULTS) {
if (return_code == SUCCEED) {
dbbind(dbproc, 1, FLT8BIND, 0, (BYTE *) &return_status);

while (dbnextrow(dbproc) != NO_MORE_ROWS) {
printf("*** return_status = %d\n", (int) return_status);
}

}
}

Any help is greatly appreciated. BTW - I'm binding to floats because I
had trouble binding to INTs elseware with FreeTDS.

Thanks,

Gerry


---
You are currently subscribed to freetds as: [rick AT alpinenetworking.com]
To unsubscribe, forward this message to
$subst('Email.Unsub')





Archive powered by MHonArc 2.6.24.

Top of Page