|
|
|
I have used this code to build a bunch of machines to talk with SQL 7.0 .
Basically below :
Go to http://www.freetds.org/ and get the lastest tgz file
http://www.freetds.org/software.html
Compile code for apache
I use this step process if you need an idea.
mod_auth_mysql.sh
mm.sh
openssl.sh
mod_ssl.sh
apache_1.sh
freetds.sh
freetype.sh
zlib.sh
libpng.sh
jpeg-6b.sh
gd.sh
FREETDS.sh
apache_2.sh
(apache_1.sh)
SSL_BASE=/usr/local/ssl \
EAPI_MM=/usr/local/src/apaches/mm-1.1.3 \
./configure \
--enable-module=ssl \
--exec-prefix=/usr/sbin \
--sysconfdir=/etc/httpd/conf
(freetds.sh)
./configure --with-tdsver=4.2
make clean
make install
SYBASE=/usr/local/freetds
LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$SYBASE/lib
export SYBASE LD_LIBRARY_PATH
then when configure PHP use --with-sybase=/usr/local/freetds/ \
for example
./configure \
--with-mysql \
--with-sybase=/usr/local/freetds/ \
--with-mm \
--with-apache=/usr/local/src/apaches/apache_1.3.20 \
--with-jpeg-dir=/usr/local/src/apaches/jpeg/jpeg-6b \
--with-xpm-dir \
--with-gd=/usr/local/src/apaches/gd-1.8.4 \
--with-pdflib=/usr/local/src/apaches/pdflib-4.0.1/bind/c \
--with-ttf=/usr/local/include \
--enabled-shared-pdflib \
--enable-trans-sid \
--enable-track-vars \
--enable-ftp
make clean
make install
as you can see this example talks to Mysql and MsSQL
You will then complete your compile of apache
(apache_2.sh)
Then edit your PHP.ini file :
[Sybase]
sybase.allow_persistent = On ; allow or prevent persistent
link
sybase.max_persistent = -1 ; maximum number of persistent
links. -1 means no limit
sybase.max_links = -1 ; maximum number of links
(persistent+non persistent). -1 means no limit
sybase.interface_file = "/usr/local/freetds/interfaces"
sybase.min_error_severity = 10 ; minimum error severity to
display
sybase.min_message_severity = 10 ; minimum message severity to
display
sybase.compatability_mode = Off ; compatability mode with old
versions of PHP 3.0.
; If on, this will cause PHP to
automatically assign types to results
; according to their Sybase
type, instead of treating them all as
; strings. This compatability
mode will probably not stay around
; forever, so try applying
whatever necessary changes to your code,
; and turn it off.
Now edit your interfaces file for to match your SQL 7.0 box.
MYSERVER
query tcp ether 172.22.71.80 1433
master tcp ether 172.22.71.80 1433
and a PHP sql call can then be used like such :
<?
function GET_EMAIL($CUSTID)
/*This builds the array of info to be displayed from the Subcribers DB*/
{
$db_conn = mssql_connect("MYSERVER","USERNAME","PASSWORD") or die(
"<strong>ERROR: Connection to MYSERVER failed</strong>" );
mssql_select_db( "master", $db_conn ) or die( "<strong>ERROR: Selecting the
database failed</strong>" );
// $Select_Query = "select distinct(email3) as USEREMAIL from subscribed where
email1 <> 'University' and email3 is not null";
$Select_Query = "select name from systypes";
$query_result = mssql_query($Select_Query) or die( "<strong>ERROR: Query
failed <hr> $Select_Query </strong>" );
while ($QueryRow = mssql_fetch_array($query_result)):
$name = $QueryRow["name"];
echo $name ."<br>";
endwhile;
return $cus_email;
?> |
|
| Logs hits to any page which includes it. Automatically utilises page access information left behind by PHP/FI2.0. Categories : Databases, PHP, mSQL, Databases | | | Recordset Class for MSSQL database Categories : PHP Classes, Databases, PHP, MS SQL Server | | | Guestbook sort by descending date and can view page by page Categories : PHP, MS SQL Server, Databases | | | How to connect to MS SQL 6.x+ database server via ODBC functions of
PHP3 compiled with iODBC and Openlink drivers under Linux. Categories : Databases, MS SQL Server, PHP, ODBC | | | Simple class for accessing databases like MSSql Server, Oracle etc by Raju Categories : PHP, MS SQL Server, Databases, PHP Classes, Oracle | | | This program allows you to upload an ODBC ressource - i.e. an MS-Access database to a MySQL server. Categories : Databases, MySQL, Complete Programs, PHP, Databases | | | Convert SQL from oracle,mysql,mssql,sqlite and odbc to SQL compatible Categories : PHP, PHP Classes, Databases, MySQL, MS SQL Server | | | [PHP5] aDB PDO LIKE Database Abstraction. Switch easily from one db server to another, strong errors management, manage transactions, queries preparation and more. Categories : PHP, PHP Classes, Databases, MS SQL Server, MySQL | | | Mssql database Manager Categories : PHP, Databases, MS SQL Server, Classes and Objects, PHP Classes | | | Unable to select text bigger than 4K from MSsql Categories : PHP, WinNT, Databases, MS SQL Server | | | Accepts a database & hostname from a user and then HTTP username and password. Uses this to connect to a MySQL database. Produces a form based on the tables it finds there to allow the user to do SELECTs, INSERTs, and DELETEs. Categories : Databases, PHP, MySQL, Complete Programs | | | Cut your MySQL Connections to 1 line of code Categories : PHP, Beginner Guides, Databases, MySQL | | | phpAds, a complete banner and ad management system with detailled tracking and stats. Categories : MySQL, Complete Programs, Ecommerce, PHP, Databases | | | Point and Click Interface ala MS Access for creating SQL statements. Categories : MySQL, Complete Programs, General SQL, PHP, Databases | | | Message of the Day - Random Message (Needs MySQL!) Categories : Databases, HTML and PHP, PHP, MySQL | |
|
|
|