PHP5 and Multiple Database Connections

PHP5 and Multiple Database Connections

am 05.08.2008 19:47:19 von kitfox69

Hello Everyone!

I am currently writing a sequence of php pages to help me retrieve data from a Pervasive 9.5 database, display that data in my web browser with a form built in to collect more data, and then will push the retrieved Pervasive data and the input data to MySQL.

I am having problems getting PHP to retrieve the data from Pervasive. I know the query is sound as I run it all the time on the Control Center, but I cannot get the ODBC connector to work in the page itself.

I am also concerned that I will not be able to get the page to push the data to MySQL once I do get it to retrieve.

Is this possible?

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP5 and Multiple Database Connections

am 05.08.2008 21:04:39 von Micah Gersten

Have you tested the DSN outside of PHP? Openoffice.org Database has
facilities to test ODBC connections.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com


kitfox69@comcast.net wrote:
> Hello Everyone!
>
> I am currently writing a sequence of php pages to help me retrieve data from a Pervasive 9.5 database, display that data in my web browser with a form built in to collect more data, and then will push the retrieved Pervasive data and the input data to MySQL.
>
> I am having problems getting PHP to retrieve the data from Pervasive. I know the query is sound as I run it all the time on the Control Center, but I cannot get the ODBC connector to work in the page itself.
>
> I am also concerned that I will not be able to get the page to push the data to MySQL once I do get it to retrieve.
>
> Is this possible?
>
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP5 and Multiple Database Connections

am 05.08.2008 22:18:43 von kitfox69

Yes I am sure the ODBC works as it is installed on my laptop and I use Excel to import many various queries of data.
-------------- Original message ----------------------
From: Micah Gersten
> Have you tested the DSN outside of PHP? Openoffice.org Database has
> facilities to test ODBC connections.
>
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
>
>
> kitfox69@comcast.net wrote:
> > Hello Everyone!
> >
> > I am currently writing a sequence of php pages to help me retrieve data from a
> Pervasive 9.5 database, display that data in my web browser with a form built in
> to collect more data, and then will push the retrieved Pervasive data and the
> input data to MySQL.
> >
> > I am having problems getting PHP to retrieve the data from Pervasive. I know
> the query is sound as I run it all the time on the Control Center, but I cannot
> get the ODBC connector to work in the page itself.
> >
> > I am also concerned that I will not be able to get the page to push the data
> to MySQL once I do get it to retrieve.
> >
> > Is this possible?
> >
> >
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP5 and Multiple Database Connections

am 05.08.2008 22:20:54 von Micah Gersten

What does the connector return to you when you connect in PHP?

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



kitfox69@comcast.net wrote:
> Yes I am sure the ODBC works as it is installed on my laptop and I use Excel to import many various queries of data.
> -------------- Original message ----------------------
> From: Micah Gersten
>
>> Have you tested the DSN outside of PHP? Openoffice.org Database has
>> facilities to test ODBC connections.
>>
>> Thank you,
>> Micah Gersten
>> onShore Networks
>> Internal Developer
>> http://www.onshore.com
>>
>>
>> kitfox69@comcast.net wrote:
>>
>>> Hello Everyone!
>>>
>>> I am currently writing a sequence of php pages to help me retrieve data from a
>>>
>> Pervasive 9.5 database, display that data in my web browser with a form built in
>> to collect more data, and then will push the retrieved Pervasive data and the
>> input data to MySQL.
>>
>>> I am having problems getting PHP to retrieve the data from Pervasive. I know
>>>
>> the query is sound as I run it all the time on the Control Center, but I cannot
>> get the ODBC connector to work in the page itself.
>>
>>> I am also concerned that I will not be able to get the page to push the data
>>>
>> to MySQL once I do get it to retrieve.
>>
>>> Is this possible?
>>>
>>>
>>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
>
>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP5 and Multiple Database Connections

am 06.08.2008 03:42:31 von kitfox69

Here are the messages that are currently displayed and my current script:

Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in D:\xampp\htdocs\test2.php on line 11

Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in D:\xampp\htdocs\test2.php on line 17

Warning: odbc_result_all(): supplied argument is not a valid ODBC result resource in D:\xampp\htdocs\test2.php on line 19

Warning: odbc_close(): supplied argument is not a valid ODBC-Link resource in D:\xampp\htdocs\test2.php on line 21


// BEGIN SCRIPT //

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


Today's Customers
content="text/html; charset=iso-8859-1" />



$conn = odbc_connect("HOMES", "", "");

$query = ("SELECT sls_his_cust_id FROM CUST where sls_his_prchdat_alt = 20080801");

$result = odbc_exec($conn, $query);

odbc_result_all($result);

odbc_close($conn);
?>



// END SCRIPT //

HOMES is created on the local server as a DSN using the Pervasive ODBC connector and I know it works because I have used it with SQLyog to migrate data unto MySQL


-------------- Original message ----------------------
From: Micah Gersten
> What does the connector return to you when you connect in PHP?
>
> Thank you,
> Micah Gersten
> onShore Networks
> Internal Developer
> http://www.onshore.com
>
>
>
> kitfox69@comcast.net wrote:
> > Yes I am sure the ODBC works as it is installed on my laptop and I use Excel
> to import many various queries of data.
> > -------------- Original message ----------------------
> > From: Micah Gersten
> >
> >> Have you tested the DSN outside of PHP? Openoffice.org Database has
> >> facilities to test ODBC connections.
> >>
> >> Thank you,
> >> Micah Gersten
> >> onShore Networks
> >> Internal Developer
> >> http://www.onshore.com
> >>
> >>
> >> kitfox69@comcast.net wrote:
> >>
> >>> Hello Everyone!
> >>>
> >>> I am currently writing a sequence of php pages to help me retrieve data from
> a
> >>>
> >> Pervasive 9.5 database, display that data in my web browser with a form built
> in
> >> to collect more data, and then will push the retrieved Pervasive data and the
> >> input data to MySQL.
> >>
> >>> I am having problems getting PHP to retrieve the data from Pervasive. I know
> >>>
> >> the query is sound as I run it all the time on the Control Center, but I
> cannot
> >> get the ODBC connector to work in the page itself.
> >>
> >>> I am also concerned that I will not be able to get the page to push the data
> >>>
> >> to MySQL once I do get it to retrieve.
> >>
> >>> Is this possible?
> >>>
> >>>
> >>>
> >> --
> >> PHP Database Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >>
> >
> >
> >
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: PHP5 and Multiple Database Connections

am 06.08.2008 03:51:38 von Micah Gersten

Is it set up as a system DSN or User DSN. Try testing an app as the
same user as the webserver and see if you can connect to the DSN.

Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com



kitfox69@comcast.net wrote:
> Here are the messages that are currently displayed and my current script:
>
> Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified, SQL state IM002 in SQLConnect in D:\xampp\htdocs\test2.php on line 11
>
> Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in D:\xampp\htdocs\test2.php on line 17
>
> Warning: odbc_result_all(): supplied argument is not a valid ODBC result resource in D:\xampp\htdocs\test2.php on line 19
>
> Warning: odbc_close(): supplied argument is not a valid ODBC-Link resource in D:\xampp\htdocs\test2.php on line 21
>
>
> // BEGIN SCRIPT //
>
> > "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
>
>
> Today's Customers
> > content="text/html; charset=iso-8859-1" />
>
>
> >
> $conn = odbc_connect("HOMES", "", "");
>
> $query = ("SELECT sls_his_cust_id FROM CUST where sls_his_prchdat_alt = 20080801");
>
> $result = odbc_exec($conn, $query);
>
> odbc_result_all($result);
>
> odbc_close($conn);
> ?>
>
>
>
> // END SCRIPT //
>
> HOMES is created on the local server as a DSN using the Pervasive ODBC connector and I know it works because I have used it with SQLyog to migrate data unto MySQL
>
>
> -------------- Original message ----------------------
> From: Micah Gersten
>
>> What does the connector return to you when you connect in PHP?
>>
>> Thank you,
>> Micah Gersten
>> onShore Networks
>> Internal Developer
>> http://www.onshore.com
>>
>>
>>
>> kitfox69@comcast.net wrote:
>>
>>> Yes I am sure the ODBC works as it is installed on my laptop and I use Excel
>>>
>> to import many various queries of data.
>>
>>> -------------- Original message ----------------------
>>> From: Micah Gersten
>>>
>>>
>>>> Have you tested the DSN outside of PHP? Openoffice.org Database has
>>>> facilities to test ODBC connections.
>>>>
>>>> Thank you,
>>>> Micah Gersten
>>>> onShore Networks
>>>> Internal Developer
>>>> http://www.onshore.com
>>>>
>>>>
>>>> kitfox69@comcast.net wrote:
>>>>
>>>>
>>>>> Hello Everyone!
>>>>>
>>>>> I am currently writing a sequence of php pages to help me retrieve data from
>>>>>
>> a
>>
>>>>>
>>>>>
>>>> Pervasive 9.5 database, display that data in my web browser with a form built
>>>>
>> in
>>
>>>> to collect more data, and then will push the retrieved Pervasive data and the
>>>> input data to MySQL.
>>>>
>>>>
>>>>> I am having problems getting PHP to retrieve the data from Pervasive. I know
>>>>>
>>>>>
>>>> the query is sound as I run it all the time on the Control Center, but I
>>>>
>> cannot
>>
>>>> get the ODBC connector to work in the page itself.
>>>>
>>>>
>>>>> I am also concerned that I will not be able to get the page to push the data
>>>>>
>>>>>
>>>> to MySQL once I do get it to retrieve.
>>>>
>>>>
>>>>> Is this possible?
>>>>>
>>>>>
>>>>>
>>>>>
>>>> --
>>>> PHP Database Mailing List (http://www.php.net/)
>>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>>
>>>>
>>>>
>>>
>>>
>> --
>> PHP Database Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>

--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php