Skip to Content.
Sympa Menu

freetds - Re: connecting to ms sql 6.5 from rh 5.2 with php

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Christophe VG <Christophe.VanGinneken AT tvd.be>
  • To: TDS Development Group <freetds AT franklin.oit.unc.edu>
  • Subject: Re: connecting to ms sql 6.5 from rh 5.2 with php
  • Date: Sat, 29 May 1999 15:40:59 +0200


Brian Bruns wrote:
> Hmmm...Are they char/varchar fields or actually 'text' datatypes? Text
> datatypes have a whole set of dedicated functions to access. If they
> are char or varchar please send me the table layout and I'll see what
> I can do.
> Brian

Well, I've tried the following tables :

test1
=====
name type size
-------------------
id int 4
name varchar 255
nick varchar 255
text varchar 255

test2
=====
name text 16
fname text 16
id int 4

test3
=====
id int 4
name char 255

with the following php code :

(there is some comment and a question inside :) )

<?

$cnn = sybase_connect("newton", "test", "test");
/*
** When putting this on screen, it returns 1
*/
if ($cnn == 0){
echo "Unable to connect to newton.<BR>\n";
exit;

$lnk = sybase_select_db("test", $cnn);
/*
** When putting this on screen, it also returns 1
*/
if ($lnk == 0){
echo "Unable to select db.<BR>\n";
exit;

/*
** Up to here everything seems to be allright.
** When the following command is called, I just can wait forever
** I noticed one strange thing, if I eg use the sql-statement :
** "select * from dummy", referring to a table that does not
** exist, I get no error message.
** Is this normal ?
*/

$resultset = sybase_query("select * from test3", $lnk);
if($resultset == 0){
echo "No resultset returned.<br>\n";
exit;


$results = sybase_fetch_row($resultset);

for($i=0;$i<count(results);$i++)
echo $results[$i],' ';

sybase_close($cnn);


?>

I really think there must be some other problem, something like
misconfiguration. I've downloaded the sybase server suite, and will be
checking that one, some people mailed me to say it worked fine with
them, using the same setup. Though I still hope to use freeTDS, since
it's a lot lighter (and the problem got me intrigued).

Anyhow, thanks a lot for all the effort you're putting into this.

greetz,
Christophe VG




Archive powered by MHonArc 2.6.24.

Top of Page