hi, first of all congratulations for this great forum and for its 4 years...
as this is the first time im using unixodbc and freetds i have few related questions..., this is my current scenario: I have installed the php5-mssql (i installed that port because i think its my option since i want to use freetds, excuse my expierence-less)
I just installed the folow ports: php5-mssql, freetds, and unixodbc, i just use the 'make install clean' script for perform the installation proccess, and i didnt use any special paramethers or some...
Also im not sure how to config the unixodbc .conf files, because they are blank (no sample configuration)
This is the conf sections I have: this php configuration:
http://site.crafta.com/php.htm
my settings for: /usr/local/etc/freetds/interfaces.dist
Code:
pos-server
query tcp 8.0 xx.xx.xx.11 1433
mypool
query tcp 4.2 127.0.0.1 5000
master tcp 4.2 127.0.0.1 5000
my settings for: /usr/local/etc/freetds.conf.dist
Code:
[global]
# TDS protocol version
tds version = 8.0
; initial block size = 512
; swap broken dates = no
; swap broken money = no
; try server login = yes
; try domain login = no
; nt domain = GIGA
; cross domain login = no
; dump file = /tmp/freetds.log
; debug level = 10
; timeout = 10
; connect timeout = 10
text size = 64512
[mypool]
host = 127.0.0.1
port = 5000
tds version = 4.2
[pos-server]
host = xx.xx.xx.11
port = 1433
tds version = 8.0
my settings for: /usr/local/etc/odbc.ini
Code:
[pos-server]
Driver = /usr/local/lib/libtdsodbc.so
Server = xx.xx.xx.11
Database = crafta-pos
Port = 1433
TDS_Version = 8.0
my settings for: /usr/local/etc/odbcinst.ini
Code:
Driver = TDS
Description = crafta-pos Database
Trace = No
Server = xx.xx.xx.11
Database = crafta-pos
UID = MYUSERNAME
I tried to test the freetds with this command: ' tsql -S xx.xx.xx.11:1433 -U MYUSERNAME "
and with this results:
Code:
locale is "C"
locale charset is "US-ASCII"
Password: *****
Msg 20004, Level 9, State 0, Server OpenClient, Line 0
Read from SQL server failed.
Msg 20014, Level 9, State 0, Server OpenClient, Line 0
Login incorrect.
There was a problem connecting to the server
This is the php test script:
Code:
<?php
$connect = mssql_connect("pos-server", "****", "*****");
$query = "SELECT ItemLookupCode FROM Item";
$result = exec($connect, $query);
while(mssql_fetch_row($result))
{
$ItemLookupCode = mssql_result($result, 1);
echo $ItemLookupCode;
echo "\n";
}
?>
getting this errors in the browser ouput:
- Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: pos-server in /usr/local/www/data-dist/odbc.php on line 2
- Warning: exec() [function.exec]: Cannot execute a blank command in /usr/local/www/data-dist/odbc.php on line 4
- Warning: mssql_fetch_row(): supplied argument is not a valid MS SQL-result resource in /usr/local/www/data-dist/odbc.php on line 5
and...
<?php
$connect = odbc_connect("xx.xx.xx.11", "******", "******");
$query = "SELECT ItemLookupCode FROM Item";
$result = odbc_exec($connect, $query);
while(odbc_fetch_row($result)){
$ItemLookupCode = odbc_result($result, 1);
print ("$ItemLookupCode\n");
}
?>
getting this error:
Fatal error: Call to undefined function odbc_connect() in /usr/local/www/data-dist/odbc1.php on line 2
ahy help with this will be apreciated, and thanks in advance.
ALDO