Skip to Content.
Sympa Menu

freetds - Linux, PHP, ADOdb, MsSql

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Bogdan Zagan" <bogdan.zagan AT connex.ro>
  • To: freetds AT franklin.oit.unc.edu
  • Subject: Linux, PHP, ADOdb, MsSql
  • Date: Thu, 30 May 2002 02:55:30 -0400


Hello
I use a web server (Apache/1.3.22), runing on a Red-Hat/Linux(7.2),
PHP/4.1.2 and I connect to a MsSql 7.0 server runing on a
Windows/Microsoft(2000).
For this connection I usethe following libraries sybase_ct.so and odbc.so
(I'm not sure what my connection use).
When I instaled sybase It requested the installation of freedts. So I did,
with the rpm 0.52.
Well I succeded in establishing the connection but something is wrong. I
can make an Insert in the database, but when I try to select it returns
only an empty string. (If the output is an table I get a table with exact
number of lines that are in the database tables but with nothin in it)
Here is my code (for the select statement):
---------
<?php
require("./adodb/adodb.inc.php");
require("./Connections/sphinx1.php");
?><?php
$Recordset1=$sphinx1->Execute("SELECT trainer FROM dbo.trainer") or
DIE($sphinx1->ErrorMsg());
?>
---------
for display I use :
---------
<?php echo $Recordset1->Fields("TRAINER")?> or tried also <?php echo
$Recordset1->Fields("trainer")?>
---------
The sphinx1.php:
---------
<?php
if(!isset($PHP_SELF)){
$PHP_SELF=getenv("SCRIPT_NAME");
}
if (!isset($QUERY_STRING)){
$QUERY_STRING="";
}
if (!isset($REQUEST_URI)){
$REQUEST_URI=$PHP_SELF;
}
$MM_sphinx1_HOSTNAME = "10.50.169.98";
$MM_sphinx1_DBTYPE = "mssql";
$MM_sphinx1_DATABASE = "CopsWeb";
$MM_sphinx1_USERNAME = "Copsintranet";
$MM_sphinx1_PASSWORD = "intranet";
$QUB_Caching = false;
ADOLoadCode($MM_sphinx1_DBTYPE);
$sphinx1=&ADONewConnection($MM_sphinx1_DBTYPE);
if($MM_sphinx1_DBTYPE == "access" || $MM_sphinx1_DBTYPE == "odbc"){
$sphinx1->PConnect($MM_sphinx1_DATABASE,
$MM_sphinx1_USERNAME,$MM_sphinx1_PASSWORD);
} else if($MM_sphinx1_DBTYPE == "ibase") {


$sphinx1->PConnect($MM_sphinx1_HOSTNAME.":".$MM_sphinx1_DATABASE,$MM_sphinx1_USERNAME,$MM_sphinx1_PASSWORD);

} else {


$sphinx1->PConnect($MM_sphinx1_HOSTNAME,$MM_sphinx1_USERNAME,$MM_sphinx1_PASSWORD,$MM_sphinx1_DATABASE);

}
?>
----------

Thank you for your HELP.
I face this problem for more than 4 days now.



  • Linux, PHP, ADOdb, MsSql, Bogdan Zagan, 05/30/2002

Archive powered by MHonArc 2.6.24.

Top of Page