The Blog

PHP ODBC MAS90/200 Posted on

Create System DSN MAS90PHP best if you copy SOTAMAS90 DSN add username and password to it. And make sure you run apache under user that has access to mas90 share even in mas200. Below is code that you can test connection with.

<?php
$conn = odbc_connect('MAS90PHP','','');
if (!$conn)
{exit("Connection Failed: " . $conn);}
else
echo"Connected<BR>";

$query = "SELECT * FROM GL_Audit";
$result = odbc_exec($conn, $query) or die(odbc_errormsg());

while(odbc_fetch_row($result)){
echo odbc_result($result, "FieldName") . "<br>";

}

odbc_close($conn);
echo"Connection Closed";
?>
This entry was posted in PHP. Bookmark the permalink.

Please Post Your Comments & Reviews

Your email address will not be published. Required fields are marked *



CAPTCHA
Change the CAPTCHA codeSpeak the CAPTCHA code