Integration Question

They have: 68 posts

Joined: Jun 2006

I'm designing an intranet for a business running a windows server and using a 4D database system. I'm trying to integrate the two and having a few problems. There might be alternative methods for completing these tasks, so if you know of any, please let me know, since it seems like 4D isn't very commonly used in this way.

1. The database keeps track of all the employees birthdays and dates of hire, so when it's one or the other, 4D sends monitors around the building the information and it displays the name, whatever is going on and a picture.

I want to do something similar on the intranet. The DB can drop the appropriate picture, name and occasion in a folder.. but I don't know how to pair the two up (assuming there is multiple in one day).

Basically, I don't know how to put in 4D variable code into the HTML/PHP code and make it the two coexist. But, like I said, I thought there might be another way to do this that makes it easier on me by not using the DB as much.

I appreciate anyone's help or ideas.

FrankR's picture

He has: 45 posts

Joined: Oct 2006

Did you ever figure out what to do? Is 4D a particular database product by http://www.4d.com? I am not clear if it is a standard relational database or something else.

Author of SQL Converter for Excel, which is an Excel add-in for converting data to MySQL.

They have: 68 posts

Joined: Jun 2006

I haven't figured it out yet.. still trying to do it through 4D.

The product, as far as I can tell, is simply 4th Dimension, but 4d.com is their web site.

I posted on here in hopes someone might have an idea through a different methodology.

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

I would guess the answer lies with ODBC; the Windows version of PHP comes with support for ODBC built-in. General information on PHP ODBC functions are available at: http://www.php.net/odbc (there's a useful function list at the bottom).

As far as I can see, you open a connection with an odbc_connect(); query the database using the odbc_exec(); then close the connection using odbc_close().

You iterate through the results in the following manner: -

<?php
while ($row = odbc_fetch_array($result)) {
   echo
$row['column_name'];
   ...
etc ...
}
?>

The remaining problem is finding out what to pass to the odbc_connect() function, particularly the first argument (the dsn). That's assuming ODBC is available for 4D at all! It should be in the software package somewhere, unfortunately a driver doesn't appear on their web site.

a Padded Cell our articles site!

JeevesBond's picture

He has: 3,956 posts

Joined: Jun 2002

As an example of what to pass as a DSN (the first parameter of odbc_connect()) I found the IBM DB2 ODBC driver connection string in an article (good bit's 3/4 way through the article). It looks like this: -
DRIVER={IBM DB2 ODBC DRIVER};HOSTNAME=localhost;DATABASE=dbname;PROTOCOL=TCPIP;PORT=1527;'

a Padded Cell our articles site!

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.