Skip to Content.
Sympa Menu

freetds - whither goest PHP sample?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Brian Wilson <bwilson AT ihpva.org>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: whither goest PHP sample?
  • Date: Fri, 20 Apr 2001 10:33:43 -0700


Regarding PHP and FreeTDS, the new userguide says thus:

"Now everything should run. There is a sample PHP script in the
FreeTDS samples directory called odbctest.php."

( Reference: http://www.freetds.org/userguide/x621.htm )

Has anyone seen this file 'odbctest.php'? My 0.51 'samples' directory
has only a single file called "debug.c". 0.50, 0.47, 0.46 all had
more files, but still all just *.c stuff; it looks like they are test
files, not samples. Does the project needs some sample files???

Is there someone willing to send me a sample PHP/FreeTDS file that
works? I have successfully built PHP but haven't been able to connect
to my SQL7 DB yet. My DBI perl scripts work fine so I know that the
connection is functioning. I am using SQL7sp3/NT4sp6A + RH 6.2 Linux/PHP
4.0.4p11

Below is my own test code... which fails to connect.

--Brian

---cut here---
$host = 'dbsrvr'; # references into /usr/local/freetds/interfaces
$user = 'track_admin'; $pass = 'XXXXXXXX';
$dbname = 'CNSQL7';

print "SYBASE=$SYBASE <BR>\n"; # PRINTS /usr/local/freetds
print "PHPRC=$PHPRC <BR>\n"; # PRINTS /usr/local/apache/conf

if ($db = sybase_connect($host, $user, $pass)) {
print "I connected!\n";
} else {
print "Bummer; connect failed. <BR>\n";
exit; # ALWAYS EXITS HERE
}

if ($result = sybase_select_db($dbname, $db)) {
print "$dbname selected! <BR>\n";
}

$query = "SELECT DefectId,Descript,Analysis FROM defects";

if ($result = sybase_query($query, $db)) {
print "$query worked! <BR>\n";
}

//rest of script deleted...

---cut here---
In /usr/local/freetds/interfaces I have something like this:

dbsrvr
query tcp ether 192.168.148.128 1433
master tcp ether 192.168.148.128 1433








Archive powered by MHonArc 2.6.24.

Top of Page