Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 6073 days old. Please don't post here. Open a new topic instead.

Recommended Posts

  • Newbies
Posted

Hi there everyone! Ok so I'm just a web developer, not a FileMaker user, but my client is needing something kinda tricky here.

They have a website hosted on CentOS 5 in the Midwest US, and their FM9 Server is located remotely on Maui, on their lan in their office. I have been contracted to create a php script which can either (hopefully) use the existing php odbc drivers or, as they were instructed by a FM rep, to use the DataDirect Unix ODBC driver.

All I'm trying to accomplish first off is telling the PHP script on the CentOS box to connect via IP and correct port to the FM9 server at their office, query 1 table, and return the resultset to the php page. If this goes well, next step is for me to see if we can do read and write access based off of user input on their website. Complicated? Yes. Security issues? Probably! lol

So my first question is, how can I take this script and tell it the right php odbc driver to use, as well as the IP and port to connect to?


<?php

//================================================================



  // All CAPS info is hidden for obvious reasons.   This is all commented out.  What can I use here?

  //$db_host        = "IP:PORT";

  //$db_server_name = "PwfProgramsDB_DSN_Per";

  //$db_name        = "PwfProgramsDB";

  //$db_file        = 'C:Program FilesFileMakerFileMaker ServerDataDatabasesPwfProgramsDB.fp7';

  //$db_conn_name   = "php_script";

  //$db_user        = "USERNAME";

  //$db_pass        = "PASSWORD";







$db = odbc_connect("PwfProgramsDB_DSN_Per", "USERNAME", "PASSWORD");



if( odbc_error($db) ){

die(odbc_error($db).': '.odbc_errormsg($db));

}



$query = 'SELECT First,Last,Address FROM person';

$result = odbc_exec($db, $query) or die('

Query error !

');



odbc_fetch_row($result);

$res1 = odbc_result($result, 1);

$res2 = odbc_result($result, 2);

print("$res1 $res2n");



odbc_close($db);





?>

This script returns

Fatal error: Call to undefined function odbc_connect() in /opt/lampp/htdocs/client/connection.php on line 15

This topic is 6073 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.