If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Pervasive.SQL > PSQL, PHP, Windows Server Setup Question

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-29-09, 11:23
evosonic evosonic is offline
Registered User
 
Join Date: Jan 2009
Posts: 2
PSQL, PHP, Windows Server Setup Question

Hello, I am trying to do some preliminary legwork for a possible upcoming project that would include me connecting to a PSQL DB (Windows version (possibly on another physical server)) from a webserver (again Windows Server) that is running Apache and PHP.

Is this setup even possible?
Reply With Quote
  #2 (permalink)  
Old 01-29-09, 13:44
mirtheil mirtheil is online now
Registered User
 
Join Date: Dec 2001
Posts: 1,026
It's possible. You'll need to use ODBC from PHP to access PSQL. It'll work locally or remotely.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
  #3 (permalink)  
Old 01-29-09, 13:55
evosonic evosonic is offline
Registered User
 
Join Date: Jan 2009
Posts: 2
Thank you for the reply. So, I am thinking that I would install PSQL client on the webserver then reference the pervasive driver using odbc_connect in PHP.

I started looking for the exact syntax to use to accomplish this and I found this thread: [PHP] odbc_connect always returns error IM002 - Pervasive Community Site

However, I cannot see the entire post. It seems to chop off the end of the string:

"$conn=odbc_connect("Driver={Pervasive ODBC Client Interface};ServerName"

What is the rest of the connection string?
Reply With Quote
  #4 (permalink)  
Old 01-29-09, 14:29
mirtheil mirtheil is online now
Registered User
 
Join Date: Dec 2001
Posts: 1,026
The line in one of my posts was:
Code:
$connect = odbc_connect('Driver={Pervasive ODBC Client Interface};ServerName=server_name;ServerDSN=Server_Engine_DSN_name;', 'username', 'password')
I was able to copy it even though it wasn't displayed.


You can always just create a Client DSN on the webserver and use that instead of the connection string.
__________________
Mirtheil Software
Certified Pervasive Developer
Certified Pervasive Technician
Custom Btrieve/VB development
http://www.mirtheil.com
I do not answer questions by email. Please post on the forum.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On