Re: PHP5 and Multiple Database Connections

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 //

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
<html xmlns="http://www.w3.org/1999/xhtml";>
<head>
<title>Today's Customers</title>
<meta http-equiv="content-type"
content="text/html; charset=iso-8859-1" />
</head>
<body>
<?php

$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);
?>
</body>
</html>

// 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 <micah@xxxxxxxxxxx>
> 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@xxxxxxxxxxx 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 <micah@xxxxxxxxxxx>
> >   
> >> 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@xxxxxxxxxxx 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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux