Quantcast
Channel: SCN: Message List - SAP Adaptive Server Enterprise (SAP ASE) for Custom Applications
Viewing all articles
Browse latest Browse all 3587

Using PHP to connect via the ODBC driver

$
0
0

Hi All,

 

Has anyone successfully connected to a SAP ASE database from PHP?  Right now I'm having to load data into a mySQL and its definitely not ideal.

 

Thanks all!

 

o far I've tried unixODBC:

/usr/bin/odbcinst -i -d -f drivertemplate.txt   

/usr/bin/odbcinst -i -s -f sampletemplate.txt


cat drivertemplate.txt

[Adaptive Server Enterprise]

Description = Sybase ODBC Driver

Driver = /sybase/DataAccess64/ODBC/lib/libsybdrvodb-sqllen8.so

FileUsage = -1


cat sampletemplate.txt

[KYLEDSN]

Description = SAP ODBC Data Source

UserID = sa

Password = password

Driver = Adaptive Server Enterprise

Server = KYLE

Port = 5000

Database = master

UseCursor = 1


<?php

$conn = odbc_connect("DRIVER={SAP ODBC Data Source};Server=localhost;Database=KYLE", "sa", "password");

 

$sql = "SELECT name from sysobjects";

$rs = odbc_exec($conn,$sql);

echo "<table><tr>";

echo "<th>Name</th></tr>";

while (odbc_fetch_row($rs))

{

$name = odbc_result($rs,"name");

echo "<tr><td>$name</td></tr>";

}

odbc_close($conn);

echo "</table>";

?>


Viewing all articles
Browse latest Browse all 3587

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>