dbTalk Databases Forums  

D3 ODBC - PHP

comp.databases.pick comp.databases.pick


Discuss D3 ODBC - PHP in the comp.databases.pick forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
terrymaui
 
Posts: n/a

Default D3 ODBC - PHP - 05-22-2011 , 08:19 PM






Aloha all, I've done tons of apps using vb & d3 odbc with great
success. Currently running d3/linux v9 which has the mvsp .net api but
so far I've not been very happy with my results. My question is: Has
anyone ever had any luck using php & the d3clodbc together to do such
things as call cataloged subroutines from a d3 server?

For years I've used the "jd3" project to interface php to a d3 box and
it allows such operations but it can be tempermental at times and lock
up its ports one by one until none remain available. I'd much prefer
to use just the odbc tools to do everything I need.

Reply With Quote
  #2  
Old   
MAV
 
Posts: n/a

Default Re: D3 ODBC - PHP - 05-23-2011 , 03:45 AM






We use JD3 successfully in some web projects (D3/Linux and D3/Win).
The main problem is an "ABORT" in a subroutine called by JD3. No
problem with careful programming.

Regards,

Marcos Alonso Vega

Reply With Quote
  #3  
Old   
Specific
 
Posts: n/a

Default Re: D3 ODBC - PHP - 05-23-2011 , 01:31 PM



I've had no issues using php5 and d3 v7.4.2 with the c32 odbc drivers. I use it to pull inventory and pricing from our system to our online catalog, as well as for various other reports.

I don't think that you can call pick subroutines directly from php odbc. Instead, I create programs that parse arguments from the TCL line to act as subroutines. The odbc statement looks something like "]cataloged-program arg1, arg2, arg3..." The programs output must return a table, and the fieldsize depends on how many spaces you leave between the headers.

Reply With Quote
  #4  
Old   
terrymaui
 
Posts: n/a

Default Re: D3 ODBC - PHP - 05-23-2011 , 08:15 PM



Many thanks for the tip. Any idea what an odbc_connect string would
look like when running the php on the same server as the d3? I've
found examples for the more common database platforms on localhost but
not for pick/d3. I assume a successful odbc_connect must precede the
calling of a program?

Thanks in advance,
Terry


On May 23, 8:31*am, Specific <domp... (AT) gmail (DOT) com> wrote:
Quote:
I've had no issues using php5 and d3 v7.4.2 with the c32 odbc drivers. *I use it to pull inventory and pricing from our system to our online catalog, as well as for various other reports.

I don't think that you can call pick subroutines directly from php odbc. *Instead, I create programs that parse arguments from the TCL line to actas subroutines. *The odbc statement looks something like "]cataloged-program arg1, arg2, arg3..." *The programs output must return a table, and the field size depends on how many spaces you leave between the headers.

Reply With Quote
  #5  
Old   
Specific
 
Posts: n/a

Default Re: D3 ODBC - PHP - 05-24-2011 , 12:47 AM



I'll assume that you're using PHP on Windows since tigerlogic hasn't released client drivers for any other platform. You can download the D3 ODBC Driver from ftp://ftp.tigerlogic.com/pub/ODBC/2.0.x/Releases/.

After you have installed the d3 odbc driver go to "control panel"->"Administrative Tools" and select Data Sources (ODBC). Select the System DNS tab and click the add button. After selecting the D3 ODBC Driver you'll be prompted to enter information about the D3 system (DNS Name, Host Address, Virtual Machine Name, Version, User ID / Password, etc). After providing the information needed to connect in the data source, you can connect by using the following:

$connection = odbc_connect("DNS_NAME","","");

$connection must be a valid resource in order to send commands.

Good luck =)

Reply With Quote
  #6  
Old   
Tony Gravagno
 
Posts: n/a

Default Re: D3 ODBC - PHP - 05-24-2011 , 05:34 PM



terrymaui wrote:

Quote:
Currently running d3/linux v9 which has the mvsp .net api but
so far I've not been very happy with my results
Why not use the MVSP Java binding?

What makes you unhappy with your current results?

To use any MV platform from any language, just create a standalone
class that wraps your connectivity method of choice, expose a generic
interface of your own design, and from that point forward you're not
dealing with MV, you're dealing with just another library like any
other that you'd download somewhere. As an example for the currently
defined problem, research how to call Java from PHP then use MVSP
within your own Java class that can be called from PHP. If you want a
Windows client with PHP to call D3 Linux, you can use .NET or Java -
just research calling .NET libs from PHP.

I've done this with various libraries in various languages and I've
been threatening to publish the code and/or the API definitions for a
couple years, I just haven't had time. Anyone could do this really.

T

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.