Jump to content

ODBC


strocknar

Recommended Posts

So i've got this server running a Progress DB.  I need to connect to it using PHP to pull customer/product data.  My web server is running FC6 with Apache and PHP.  I got iODBC installed and connecting to the database and created a simple page to create a connection:

 

<?php
      $conn = odbc_connect(DSN, NAME, PASS) or die ("error connecting");
?>

 

I just want to see if the page will run successfully.  It seems to except for one small thing.  When I run the file in a web browser it asks if I want to save it.  Any ideas why this would be happening?

Link to comment
https://forums.phpfreaks.com/topic/42728-odbc/
Share on other sites

Probably should have been more specific.

the code:

<?php
$fname = "./dled.php";
$handle = fopen($fname, "r");
$contents = fread($handle, filesize($fname));
echo $contents;
fclose($handle);
?>

 

Outputs

Warning: fread() [function.fread]: Length parameter must be greater than 0

 

so technically nothing

Link to comment
https://forums.phpfreaks.com/topic/42728-odbc/#findComment-207361
Share on other sites

Are you using the Merant ODBC driver? Its quirky at best. I don't think I ever found a PROGRESS ODBC driver for *nix. Mine is set up on a Windows box, but it works.

 

1) Set up a system DSN. Set the isolation level to "READ UNCOMMITED" or it will lock other users out when  you are querying tables.

2)  In php try something like this

$dsn = 'PROGRESS';

$user = 'odbcuser';

$pw = 'password';

$odbc_con  = odbc_connect($dsn,$user,$pw,SQL_CUR_USE_ODBC) or die(odbc_error());

Link to comment
https://forums.phpfreaks.com/topic/42728-odbc/#findComment-207405
Share on other sites

Frost: those two websites as well as http://jehiah.cz/archive/compiling-shared-php-modules are what I used to set up PHP.  I had lampp installed and didn't want to recompile php/apache.

 

boo:  after that, page comes up blank.

 

artacus:  I'm using the ODBC driver from the progress website (progress.com i think).  You have to have aaccount with them to log in and all that fancy stuff in order to get it tho.  I had to get the driver from the provider of a seperate piece of software (the one connecting to this godforsaken database in the firstplace).

 

P.S.  Thank you all for your help

Link to comment
https://forums.phpfreaks.com/topic/42728-odbc/#findComment-207410
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.