Re: [PHP-DB] odbc vs. oci8
Julien Bonastre a écrit : and relation to Ronald Rivest?? As in the "Ronald Rivest, Leonard Adleman, Adi Shamir?" RSA Encryption Rivest? Just curious :-) No! :) -- Alain -- http://www.vivahate.org -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] odbc vs. oci8
Christopher Jones a écrit : Alain Rivest wrote: Hi, which one is the fastest: odbc or oci8? I use PHP 5 with IIS on Windows Server 2003 with Oracle 8 and 9 on several Alpha Servers with OpenVMS. Which one should I choose, odbc or oci8? Does oci8 works with Oracle 9i? For now I wrote my web applications with odbc support because the other apps at my job were usings that. But it's a bit slow and since I don't really know the difference I chose odbc... Any advice? Thanks a lot! Use OCI8 it will be fastest. Specifically, use the refactored oci8 driver, which is not yet in the PHP 5 source bundle: http://netevil.org/node.php?uuid=431eeaf6-5744-8225-2552-31eeaf6e8506 The oci8 driver works with Oracle 8, 9 and 10. Ok thanks I'll try that! -- Alain -- http://www.vivahate.org -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] ODBC Problem
Good morning, I have almost the same problem, but just with cirilic characters. I have this state on every page, html and php: if I try to show cirilic characters I don't have problems. If I try to insert names in cirilic then I have problems with some characters only. If I insert the names in latin characters I don't have anykind of problems. I have tried with phpMyAdmin interface. I can insert cirilic characters without problems, but if later I take this datas to my web site I obtain just . And if I read the cirilic characters I have introduced by the website there is no sense. I have tried changing the charset on both, database and website, without results. I have changed from POST to GET without fine result. Maybe an Apache problem? I am testing it right now. Lost, just lost. Kind regards, Serafin Matthias Willerich wrote: > this sounds a little bit like a wrong charset. I don't know which one your > database or your php is running on, but, for a start, play with this: > - charset of the file: If you open your file in an editor that allows > storing it as different kinds of charsets, try saving it as something > else. It's probably ANSI, try UTF-8 or Unicode. > - charset of delivery: If your request ends in one or the other form of > html, remember to put in a content type, like this: > > again, play around with the variable $charset, or, instead, hardcode it in > the way you need it. I'm not sure about this, but maybe you can change the > same thing by changing the character encoding in your browser manually and > not putting in any content-type. Once you've found what you need, put it > in as meta tag. > > Cheers, > Matthias > > > -Original Message- > From: Rodrigo Haces [mailto:[EMAIL PROTECTED] > Sent: 10 October 2005 23:13 > To: php-db@lists.php.net > Subject: [PHP-DB] ODBC Problem > > > Hi all: > > Im currently using php to connect to a database in another server, this > is a > intersystems cache database. > > if i do a query to my database and the result has special spanish > characters like "´" (á,é,í,ó,ú) it returns me another character, this one > changes from time to time, i just tried to make a test with the isql shell > program, i connect and ask for the same query and in shell it returns the > correct characters. > > If someone can help me please i'll apretiate. > > Thanks > rodrigo > > -- > 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: [PHP-DB] ODBC Problem
this sounds a little bit like a wrong charset. I don't know which one your database or your php is running on, but, for a start, play with this: - charset of the file: If you open your file in an editor that allows storing it as different kinds of charsets, try saving it as something else. It's probably ANSI, try UTF-8 or Unicode. - charset of delivery: If your request ends in one or the other form of html, remember to put in a content type, like this: again, play around with the variable $charset, or, instead, hardcode it in the way you need it. I'm not sure about this, but maybe you can change the same thing by changing the character encoding in your browser manually and not putting in any content-type. Once you've found what you need, put it in as meta tag. Cheers, Matthias -Original Message- From: Rodrigo Haces [mailto:[EMAIL PROTECTED] Sent: 10 October 2005 23:13 To: php-db@lists.php.net Subject: [PHP-DB] ODBC Problem Hi all: Im currently using php to connect to a database in another server, this is a intersystems cache database. if i do a query to my database and the result has special spanish characters like "´" (á,é,í,ó,ú) it returns me another character, this one changes from time to time, i just tried to make a test with the isql shell program, i connect and ask for the same query and in shell it returns the correct characters. If someone can help me please i'll apretiate. Thanks rodrigo -- 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: [PHP-DB] odbc quest
>$sql = "SELECT * FROM users WHERE username='$username' AND password='$password'"; >$result = odbc_exec($dbConnection, $sql); > >while ($rows = odbc_fetch_array($result)) { > //This doesn't work with odbc_fetch_object either > print $rows->COLUMNNAME; >} It's returning an array, not an object (I can't speak as to how the odbc_fetch_object function behaves - it seems poorly documented, but it looks like you get back something more fancy than a simple object with named variables). In short, use odbc_fetch_array and refer to the items as $rows["COLUMNNAME"] (or use single quotes). - Martin Norland, Database / Web Developer, International Outreach x3257 The opinion(s) contained within this email do not necessarily represent those of St. Jude Children's Research Hospital. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] ODBC Column Name Truncation
The reason is because the buffer used by the odbc extension to store field names is only 32 bytes. You can try using the sybase or odbtp extension. Otherwise, you will have to submit it as a bug, so that it will be fixed. -- bob On Thu, 9 Sep 2004, Anthony Robins wrote: > When retrieving ODBC results from Sybase SQL Anywhere 6 and 9, the > column names are being truncated to 31 characters. -- > > $DBN = 'thedbn'; > $UID = 'theuid'; > $PWD = 'thepws'; > > $CONN = odbc_connect( $DBN, $UID, $PWD ) or die( "Cannot connect to > $DBN."); $sql = "select * from crap"; $result = odbc_exec( $CONN, > $sql ); > > for( $i = 1 ; $i <= odbc_num_fields( $result ) ; $i++ ) { >$name = odbc_field_name( $result, $i ); >${$name} = odbc_result( $result, $name ); >print( "$i: $name - ${$name}\n" ); > } > ?> > > Result: > 1: key - 4 > 2: a_really_long_name_that_is_long - 5 > 3: longer_name - 6 > > I expected #2 to have the name: > a_really_long_name_that_is_longer_than_31_characters > > -- This happens even if the column name is simply specified using sql > 'AS' (i.e. "select column as > a_really_long_name_that_is_longer_than_31_characters from crap" would > still return "a_really_long_name_that_is_long" as the column name). > > Using PHP 4.3.4 on Windows 2000 Server. Have also tried on SUSE Linux > as well as with PHP 5. > > -- > 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: [PHP-DB] ODBC avec PHP
The latest version of ADODb supports odbtp. You can get it at http://odbtp.sourceforge.net. There are 2 versions of the ADODb driver: odbtp and odbtp_unicode. The problem you are having is caused by the inability of the ODBC driver to provide what the desired information. The FreeTDS ODBC driver still needs some more work. The odbtp extension currently provides the most complete support for SQL Server 2000. -- bob On Thu, 8 Jul 2004, Jean-François Léost wrote: > Hi > Thanks for your answer but : > > What is odbtp extension I don't find it on www.php.net ??? > > I use ADOdb to database abstraction and I can't change all the ADOdb code. > > Do you know why the function "odbc_field_type" don't give me the good result > ? > Is is a PHP error, an unixODBC error or a freeTDS error ? > > To acces to MsSqlServer, which ODBC connection do you prefer ? > > thx to help me > Jeff > > > "Robert Twitty" <[EMAIL PROTECTED]> a écrit dans le message de > news:[EMAIL PROTECTED] > You will have much better results if you use the odbtp extension instead > of the odbc extenstion, especially on Linux. The odbtp_field_type() > function will give you the correct type name. > > Also, you could use the mssql extension. However, mssql_field_type() > returns type names that are not exact. For example, it returns "char" for > all character fields even if their type is "varchar", "text", "nchar", > "nvarchar" or "ntext". > > -- bob > > On Thu, 8 Jul 2004, Jean-François Léost wrote: > > > hi > > > > I want to use the function "odbc_field_type" on a linux mandrake 10 with > PHP > > 4.3.7 with unixODBC et freeTDS > > > > This function never give me a good answer : > > > > Example of an answer : > > Xÿ¿p [EMAIL PROTECTED] [EMAIL PROTECTED]@[EMAIL PROTECTED]@ > > > > Someone can help me ? > > > > Jeff > > > > -- > > 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: [PHP-DB] ODBC avec PHP
Hi Thanks for your answer but : What is odbtp extension I don't find it on www.php.net ??? I use ADOdb to database abstraction and I can't change all the ADOdb code. Do you know why the function "odbc_field_type" don't give me the good result ? Is is a PHP error, an unixODBC error or a freeTDS error ? To acces to MsSqlServer, which ODBC connection do you prefer ? thx to help me Jeff "Robert Twitty" <[EMAIL PROTECTED]> a écrit dans le message de news:[EMAIL PROTECTED] You will have much better results if you use the odbtp extension instead of the odbc extenstion, especially on Linux. The odbtp_field_type() function will give you the correct type name. Also, you could use the mssql extension. However, mssql_field_type() returns type names that are not exact. For example, it returns "char" for all character fields even if their type is "varchar", "text", "nchar", "nvarchar" or "ntext". -- bob On Thu, 8 Jul 2004, Jean-François Léost wrote: > hi > > I want to use the function "odbc_field_type" on a linux mandrake 10 with PHP > 4.3.7 with unixODBC et freeTDS > > This function never give me a good answer : > > Example of an answer : > Xÿ¿p [EMAIL PROTECTED] [EMAIL PROTECTED]@[EMAIL PROTECTED]@ > > Someone can help me ? > > Jeff > > -- > 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: [PHP-DB] ODBC avec PHP
You will have much better results if you use the odbtp extension instead of the odbc extenstion, especially on Linux. The odbtp_field_type() function will give you the correct type name. Also, you could use the mssql extension. However, mssql_field_type() returns type names that are not exact. For example, it returns "char" for all character fields even if their type is "varchar", "text", "nchar", "nvarchar" or "ntext". -- bob On Thu, 8 Jul 2004, Jean-François Léost wrote: > hi > > I want to use the function "odbc_field_type" on a linux mandrake 10 with PHP > 4.3.7 with unixODBC et freeTDS > > This function never give me a good answer : > > Example of an answer : > Xÿ¿p [EMAIL PROTECTED] [EMAIL PROTECTED]@[EMAIL PROTECTED]@ > > Someone can help me ? > > Jeff > > -- > 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: [PHP-DB] ODBC support
This looks really great, Bob...thx! Mark -Original Message- From: Robert Twitty [mailto:[EMAIL PROTECTED] Sent: Friday, March 12, 2004 10:19 AM To: Galbreath, Mark A Cc: '[EMAIL PROTECTED]' Subject: Re: [PHP-DB] ODBC support Hi Mark An alternative solution for connecting to MS Access is odbtp. Details are available at http://odbtp.sourceforge.net. It provides better support for ODBC, especially in regards to MS Access. Take a look at the storedqry.php example at http://odbtp.sourceforge.net/examples.html. It shows how to execute a MS Access stored query. The odbtp extension has a higher performance, and it allows you to remotely connect to your Access database from any platform. -- bob On Thu, 11 Mar 2004, Galbreath, Mark A wrote: > Yes, I'm a newbie to PHP, but I got a phpBB2 BBS online in a day and I'm > psyched. > > My problem is, the PHP docs and API mention that ODBC is built into PHP 4.x > but I can't figure out how to use it. I would like to access the M$ Access > JET engine directly from a PHP page. Any clues? > > tia, > Mark > > -- > 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: [PHP-DB] ODBC support
Hi Mark An alternative solution for connecting to MS Access is odbtp. Details are available at http://odbtp.sourceforge.net. It provides better support for ODBC, especially in regards to MS Access. Take a look at the storedqry.php example at http://odbtp.sourceforge.net/examples.html. It shows how to execute a MS Access stored query. The odbtp extension has a higher performance, and it allows you to remotely connect to your Access database from any platform. -- bob On Thu, 11 Mar 2004, Galbreath, Mark A wrote: > Yes, I'm a newbie to PHP, but I got a phpBB2 BBS online in a day and I'm > psyched. > > My problem is, the PHP docs and API mention that ODBC is built into PHP 4.x > but I can't figure out how to use it. I would like to access the M$ Access > JET engine directly from a PHP page. Any clues? > > tia, > Mark > > -- > 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: [PHP-DB] ODBC support
Take a look at ADODB (It's a good database library that supports a variety of systems): http://php.weblogs.com/ADODB Here's a quick intro: http://www.databasejournal.com/features/php/article.php/651 -Original Message- From: Galbreath, Mark A [mailto:[EMAIL PROTECTED] Sent: Thursday, March 11, 2004 2:04 PM To: '[EMAIL PROTECTED]' Subject: [PHP-DB] ODBC support Yes, I'm a newbie to PHP, but I got a phpBB2 BBS online in a day and I'm psyched. My problem is, the PHP docs and API mention that ODBC is built into PHP 4.x but I can't figure out how to use it. I would like to access the M$ Access JET engine directly from a PHP page. Any clues? tia, Mark -- 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: [PHP-DB] ODBC support
Galbreath, Mark A wrote: Yes, I'm a newbie to PHP, but I got a phpBB2 BBS online in a day and I'm psyched. My problem is, the PHP docs and API mention that ODBC is built into PHP 4.x but I can't figure out how to use it. I would like to access the M$ Access JET engine directly from a PHP page. Any clues? tia, Mark ODBC function reference is present at http://pt.php.net/manual/en/ref.odbc.php (you can choose a closer mirror if you want). Scroll down to the bottom of the page to look at the functions list and some immediate examples. Re-post if you need further information. Bruno Ferreira --- [This E-mail scanned for viruses by Declude Virus] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] ODBC with SQL Server
You cannot use the odbc & mssql extensions to read nvarchar & ntext fields. You will have to use the odbtp extension located at http://odbtp.sourceforge.net. It provides support for UNICODE data. -- bob On Fri, 13 Feb 2004, Juan Torres wrote: > Hello, > > I have a connectoin ODBC with a SQL Server database. A table has a field of > type 'nvarchar'. This field contains japanese characters. > How can I read these japanese characteres? When I read (with: "select name > from data") only read '?' character. > > Thaks very much. > Juan Torres. > > -- > 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: [PHP-DB] ODBC
Take a look at ODBTP, which is located at http://odbtp.sourceforge.net. ODBTP allows you to remotely connect to Win32-based ODBC from any machine, including Linux/UNIX. -- bob On Wed, 15 Oct 2003, Ricardo C. Fernandez de C. wrote: > Hi, > The sad part is that there is 0 documentation about how to connect to > remote ODBC DSN, or a detailed structure of how to connect to it besides > the odbc_connect(dsn,user,password), DSN could be string that tells the > function where is the dsn, what database, what driver... but is not > documented. I guess i will just read the file with the dbase funtions > and convert it to psql, its not going to be real time, but oh well, > thanks for the help. > > On Wed, 2003-10-15 at 04:07, Michael.J.Bourke wrote: > > I think you will have to create a DSN on each machine you use to serve PHP > > pages. > > Otherwise, you might want to look into using DSN-less connections instead. > > > > -Original Message- > > From: Ricardo C. Fernandez de C. [mailto:[EMAIL PROTECTED] > > Sent: 14 October 2003 16:22 > > To: php-db > > Subject: RE: [PHP-DB] ODBC > > > > > > Ok, it worked on the local machine if i do > > > > odbc_connect("telefonia","","") > > > > But, if i'm on the remote machine, i have a problem, the DSN will not > > query a Database at all, it will query 3 Fox Pro Tables, what query > > should i use then? any idea? > > > > thanks for the help :) > > > > On Tue, 2003-10-14 at 10:21, Michael.J.Bourke wrote: > > > odbc_connect requires three parameters: you have specified just one. PHP > > > takes the string between the pairs of double-quotes to be just one > > > parameter. You will also need to specify a username and password for > > access > > > to the DB. Assuming you have none, try this: > > > > > > $conn=odbc_connect("Driver={Microsoft Fox Pro Driver};Server= > > > 127.0.0.1;Database=telefonia","",""); > > > > > > -Original Message- > > > From: Ricardo C. Fernandez de C. [mailto:[EMAIL PROTECTED] > > > Sent: 14 October 2003 15:16 > > > To: [EMAIL PROTECTED] > > > Subject: [PHP-DB] ODBC > > > > > > > > > Hi all, > > > > > > I have been trying to connect to a windows ODBC controller with PHP, and > > > after reading some of the documentation, I can't make the connection > > > > > > This is the Code I'm using: > > > > > > > > $conn=odbc_connect("Driver={Microsoft Fox Pro Driver};Server= > > > 127.0.0.1;Database=telefonia,,"); > > > if(!$conn) { echo "Not connected"; } > > > ?> > > > > > > And i get this Warning Message: > > > > > > Warning: Wrong Parameter count for odbc_connect in > > > c:\apache2\htdocs\od_connect.php on line 2 > > > > > > And of course the "Not Connected" echo message. > > > > > > Any idea why is this? any good document I can read about PHP-ODBC (ODBC > > > in Windows) besides the official Documentation? any other idea? > > > > > > Thanks, > > > > > > c'ya > > > -- > > > Ricardo C. Fernández de C. > > > Fundabit - Min. de Educación, Cultura y Deporte. > > > Caracas/Venezuela > > -- > > Ricardo C. Fernández de C. > > Fundabit - Min. de Educación, Cultura y Deporte. > > Caracas/Venezuela > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > -- > Ricardo C. Fernández de C. > Fundabit - Min. de Educación, Cultura y Deporte. > Caracas/Venezuela > > -- > 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: [PHP-DB] ODBC
Hi, The only stuff i have found about foxpro and PHP is this: hertz:~# apt-cache search foxpro libphp-adodb - The 'adodb' database abstraction layer for php or do you mean something else? thanks for the help. On Wed, 2003-10-15 at 08:20, Luis M Morales C wrote: > Hello Ricardo, > > I have see an litle class on phpclasses.org that open dbase files. Now on your > main problem to connect foxpro data base with php via ODBC you must be made > the next step: > > 1) Check if your Foxpro data base have ODBC drivers installed > 2) Made the ODBC connex to create the DSN (you can check how to make an dsn > on http://www.weberdev.com) > 3) Check your php to verify foxpro api is installed (write an info php file > and find foxpro api over dump file info) > 4) Try connect to the data base > > Regards, > > LM > > On Wednesday 15 October 2003 07:24, Ricardo C. Fernandez de C. wrote: > > I guess i will just read the file with the dbase funtions > > and convert it to psql, its not going to be real time, but oh well, > > thanks for the help. -- Ricardo C. Fernández de C. Fundabit - Min. de Educación, Cultura y Deporte. Caracas/Venezuela -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] ODBC
Hello Ricardo, I have see an litle class on phpclasses.org that open dbase files. Now on your main problem to connect foxpro data base with php via ODBC you must be made the next step: 1) Check if your Foxpro data base have ODBC drivers installed 2) Made the ODBC connex to create the DSN (you can check how to make an dsn on http://www.weberdev.com) 3) Check your php to verify foxpro api is installed (write an info php file and find foxpro api over dump file info) 4) Try connect to the data base Regards, LM On Wednesday 15 October 2003 07:24, Ricardo C. Fernandez de C. wrote: > I guess i will just read the file with the dbase funtions > and convert it to psql, its not going to be real time, but oh well, > thanks for the help. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] ODBC
Hi, The sad part is that there is 0 documentation about how to connect to remote ODBC DSN, or a detailed structure of how to connect to it besides the odbc_connect(dsn,user,password), DSN could be string that tells the function where is the dsn, what database, what driver... but is not documented. I guess i will just read the file with the dbase funtions and convert it to psql, its not going to be real time, but oh well, thanks for the help. On Wed, 2003-10-15 at 04:07, Michael.J.Bourke wrote: > I think you will have to create a DSN on each machine you use to serve PHP > pages. > Otherwise, you might want to look into using DSN-less connections instead. > > -Original Message- > From: Ricardo C. Fernandez de C. [mailto:[EMAIL PROTECTED] > Sent: 14 October 2003 16:22 > To: php-db > Subject: RE: [PHP-DB] ODBC > > > Ok, it worked on the local machine if i do > > odbc_connect("telefonia","","") > > But, if i'm on the remote machine, i have a problem, the DSN will not > query a Database at all, it will query 3 Fox Pro Tables, what query > should i use then? any idea? > > thanks for the help :) > > On Tue, 2003-10-14 at 10:21, Michael.J.Bourke wrote: > > odbc_connect requires three parameters: you have specified just one. PHP > > takes the string between the pairs of double-quotes to be just one > > parameter. You will also need to specify a username and password for > access > > to the DB. Assuming you have none, try this: > > > > $conn=odbc_connect("Driver={Microsoft Fox Pro Driver};Server= > > 127.0.0.1;Database=telefonia","",""); > > > > -Original Message- > > From: Ricardo C. Fernandez de C. [mailto:[EMAIL PROTECTED] > > Sent: 14 October 2003 15:16 > > To: [EMAIL PROTECTED] > > Subject: [PHP-DB] ODBC > > > > > > Hi all, > > > > I have been trying to connect to a windows ODBC controller with PHP, and > > after reading some of the documentation, I can't make the connection > > > > This is the Code I'm using: > > > > > $conn=odbc_connect("Driver={Microsoft Fox Pro Driver};Server= > > 127.0.0.1;Database=telefonia,,"); > > if(!$conn) { echo "Not connected"; } > > ?> > > > > And i get this Warning Message: > > > > Warning: Wrong Parameter count for odbc_connect in > > c:\apache2\htdocs\od_connect.php on line 2 > > > > And of course the "Not Connected" echo message. > > > > Any idea why is this? any good document I can read about PHP-ODBC (ODBC > > in Windows) besides the official Documentation? any other idea? > > > > Thanks, > > > > c'ya > > -- > > Ricardo C. Fernández de C. > > Fundabit - Min. de Educación, Cultura y Deporte. > > Caracas/Venezuela > -- > Ricardo C. Fernández de C. > Fundabit - Min. de Educación, Cultura y Deporte. > Caracas/Venezuela > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php -- Ricardo C. Fernández de C. Fundabit - Min. de Educación, Cultura y Deporte. Caracas/Venezuela -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] ODBC
I think you will have to create a DSN on each machine you use to serve PHP pages. Otherwise, you might want to look into using DSN-less connections instead. -Original Message- From: Ricardo C. Fernandez de C. [mailto:[EMAIL PROTECTED] Sent: 14 October 2003 16:22 To: php-db Subject: RE: [PHP-DB] ODBC Ok, it worked on the local machine if i do odbc_connect("telefonia","","") But, if i'm on the remote machine, i have a problem, the DSN will not query a Database at all, it will query 3 Fox Pro Tables, what query should i use then? any idea? thanks for the help :) On Tue, 2003-10-14 at 10:21, Michael.J.Bourke wrote: > odbc_connect requires three parameters: you have specified just one. PHP > takes the string between the pairs of double-quotes to be just one > parameter. You will also need to specify a username and password for access > to the DB. Assuming you have none, try this: > > $conn=odbc_connect("Driver={Microsoft Fox Pro Driver};Server= > 127.0.0.1;Database=telefonia","",""); > > -Original Message- > From: Ricardo C. Fernandez de C. [mailto:[EMAIL PROTECTED] > Sent: 14 October 2003 15:16 > To: [EMAIL PROTECTED] > Subject: [PHP-DB] ODBC > > > Hi all, > > I have been trying to connect to a windows ODBC controller with PHP, and > after reading some of the documentation, I can't make the connection > > This is the Code I'm using: > > $conn=odbc_connect("Driver={Microsoft Fox Pro Driver};Server= > 127.0.0.1;Database=telefonia,,"); > if(!$conn) { echo "Not connected"; } > ?> > > And i get this Warning Message: > > Warning: Wrong Parameter count for odbc_connect in > c:\apache2\htdocs\od_connect.php on line 2 > > And of course the "Not Connected" echo message. > > Any idea why is this? any good document I can read about PHP-ODBC (ODBC > in Windows) besides the official Documentation? any other idea? > > Thanks, > > c'ya > -- > Ricardo C. Fernández de C. > Fundabit - Min. de Educación, Cultura y Deporte. > Caracas/Venezuela -- Ricardo C. Fernández de C. Fundabit - Min. de Educación, Cultura y Deporte. Caracas/Venezuela -- 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: [PHP-DB] ODBC
Ok, it worked on the local machine if i do odbc_connect("telefonia","","") But, if i'm on the remote machine, i have a problem, the DSN will not query a Database at all, it will query 3 Fox Pro Tables, what query should i use then? any idea? thanks for the help :) On Tue, 2003-10-14 at 10:21, Michael.J.Bourke wrote: > odbc_connect requires three parameters: you have specified just one. PHP > takes the string between the pairs of double-quotes to be just one > parameter. You will also need to specify a username and password for access > to the DB. Assuming you have none, try this: > > $conn=odbc_connect("Driver={Microsoft Fox Pro Driver};Server= > 127.0.0.1;Database=telefonia","",""); > > -Original Message- > From: Ricardo C. Fernandez de C. [mailto:[EMAIL PROTECTED] > Sent: 14 October 2003 15:16 > To: [EMAIL PROTECTED] > Subject: [PHP-DB] ODBC > > > Hi all, > > I have been trying to connect to a windows ODBC controller with PHP, and > after reading some of the documentation, I can't make the connection > > This is the Code I'm using: > > $conn=odbc_connect("Driver={Microsoft Fox Pro Driver};Server= > 127.0.0.1;Database=telefonia,,"); > if(!$conn) { echo "Not connected"; } > ?> > > And i get this Warning Message: > > Warning: Wrong Parameter count for odbc_connect in > c:\apache2\htdocs\od_connect.php on line 2 > > And of course the "Not Connected" echo message. > > Any idea why is this? any good document I can read about PHP-ODBC (ODBC > in Windows) besides the official Documentation? any other idea? > > Thanks, > > c'ya > -- > Ricardo C. Fernández de C. > Fundabit - Min. de Educación, Cultura y Deporte. > Caracas/Venezuela -- Ricardo C. Fernández de C. Fundabit - Min. de Educación, Cultura y Deporte. Caracas/Venezuela -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] ODBC
odbc_connect requires three parameters: you have specified just one. PHP takes the string between the pairs of double-quotes to be just one parameter. You will also need to specify a username and password for access to the DB. Assuming you have none, try this: $conn=odbc_connect("Driver={Microsoft Fox Pro Driver};Server= 127.0.0.1;Database=telefonia","",""); -Original Message- From: Ricardo C. Fernandez de C. [mailto:[EMAIL PROTECTED] Sent: 14 October 2003 15:16 To: [EMAIL PROTECTED] Subject: [PHP-DB] ODBC Hi all, I have been trying to connect to a windows ODBC controller with PHP, and after reading some of the documentation, I can't make the connection This is the Code I'm using: And i get this Warning Message: Warning: Wrong Parameter count for odbc_connect in c:\apache2\htdocs\od_connect.php on line 2 And of course the "Not Connected" echo message. Any idea why is this? any good document I can read about PHP-ODBC (ODBC in Windows) besides the official Documentation? any other idea? Thanks, c'ya -- Ricardo C. Fernández de C. Fundabit - Min. de Educación, Cultura y Deporte. Caracas/Venezuela -- 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: [PHP-DB] ODBC to MSSQL on FreeBSD for PHP
You should use the mssql extension for this purpose. Another alternative is odbtp. -- bob On Thu, 9 Oct 2003, rick rice wrote: > What do I need and where can I get it? > > -- > 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: [PHP-DB] odbc
I solved my problem (here). IBM came out with new drivers and they sovled the problem. THanks -Original Message- From: Simpson, Doug Sent: Monday, September 29, 2003 11:38 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] odbc I am trying to connect to an AS/400 from a Linux box running RH9. I have installed unixODBC and the iSeries drivers. I can run "cwbping" that tell me that I am connecting to the AS400. I have made a scipt the following script - ODBC Data Source When I run this script from a web browser I get the following error in my http error logs [client 172.16.32.241] PHP Warning: odbc_exec(): SQL error: [unixODBC][IBM][iSeries Access ODBC Driver][DB2 UDB], SQL state S1000 in SQLExecDirect in /var/www/htdocs/odbcquery.php on line 15 Does anyone know why I am getting this? Thank you for your time< Doug -- 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: [PHP-DB] ODBC Database
whoops, meant to include thishttp://www.mysql.com/downloads/api-myodbc-3.51.html [EMAIL PROTECTED] ane.com To: Gerard Samuel <[EMAIL PROTECTED]> cc: "Larry E.Ullman" <[EMAIL PROTECTED]>, [EMAIL PROTECTED], Robert 08/11/2003 10:37 Twitty <[EMAIL PROTECTED]> AM Subject: Re: [PHP-DB] ODBC Database there is _definitely_ a MyOdbc Driver. i'm using it Gerard Samuel <[EMAIL PROTECTED]>To: Robert Twitty <[EMAIL PROTECTED]> cc: "Larry E.Ullman" <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 08/11/2003 10:35 Subject: Re: [PHP-DB] ODBC Database AM Robert Twitty wrote: >Unless I am mistaken, but isn't there an ODBC driver available for MySQL >called MyODBC? > >-- bob > I haven't a clue. Ill look, maybe it will help me create drivers for my DB layer, as I already know MySQL. Last night I successfully connected to IBM's DB2, but I didnt get far past that as I have to figure out, how to create tables, figure out how it likes its schemas etc, to really give it a work out... -- 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: [PHP-DB] ODBC Database
Larry E.Ullman wrote: Im looking at venturing into working with PHP's ODBC extention. Does anyone have any recommendations as to a Database, that is easy to understand/get into from a novice point of view, that installs on windows 2k, and is "free"? MySQL is kind of free, installs on W2K and is easy to use but it doesn't require PHP's ODBC extension since PHP already has a good MySQL extension. If you really want to use ODBC and you have MS Office, you could try Access. What Im doing is seeing if my code will run on different databases. Of which it currently runs on mySQL, PostgreSQL and MSSQL. As soon as I can get PHP5 installed Ill be checking out SQLLite. But in the meantime, Im looking for a database that would interface with ODBC. I just downloaded IBM's DB2 Personal Edition, to see what I can do there, but, Im just looking for advice etc from others who went down this road. Thanks -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] ODBC Database
i have read an article on IBM's developerWorks website. its title should be "Leverage your Microsoft SQL Server 2000 Skills to Learn DB2 UDB Version 8" that should help you. "Gerard Samuel" <[EMAIL PROTECTED]> ??:[EMAIL PROTECTED] > Robert Twitty wrote: > > >Unless I am mistaken, but isn't there an ODBC driver available for MySQL > >called MyODBC? > > > >-- bob > > > I haven't a clue. Ill look, maybe it will help me create drivers for my > DB layer, as I already know MySQL. > Last night I successfully connected to IBM's DB2, but I didnt get far > past that as I have to figure out, > how to create tables, figure out how it likes its schemas etc, to really > give it a work out... > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] ODBC Database
there is _definitely_ a MyOdbc Driver. i'm using it Gerard Samuel <[EMAIL PROTECTED]>To: Robert Twitty <[EMAIL PROTECTED]> cc: "Larry E.Ullman" <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 08/11/2003 10:35 Subject: Re: [PHP-DB] ODBC Database AM Robert Twitty wrote: >Unless I am mistaken, but isn't there an ODBC driver available for MySQL >called MyODBC? > >-- bob > I haven't a clue. Ill look, maybe it will help me create drivers for my DB layer, as I already know MySQL. Last night I successfully connected to IBM's DB2, but I didnt get far past that as I have to figure out, how to create tables, figure out how it likes its schemas etc, to really give it a work out... -- 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: [PHP-DB] ODBC Database
Robert Twitty wrote: Unless I am mistaken, but isn't there an ODBC driver available for MySQL called MyODBC? -- bob I haven't a clue. Ill look, maybe it will help me create drivers for my DB layer, as I already know MySQL. Last night I successfully connected to IBM's DB2, but I didnt get far past that as I have to figure out, how to create tables, figure out how it likes its schemas etc, to really give it a work out... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] ODBC Database
[EMAIL PROTECTED] wrote: whoops, meant to include thishttp://www.mysql.com/downloads/api-myodbc-3.51.html Unless I am mistaken, but isn't there an ODBC driver available for MySQL called MyODBC? -- bob I haven't a clue. Ill look, maybe it will help me create drivers for my DB layer, as I already know MySQL. Last night I successfully connected to IBM's DB2, but I didnt get far past that as I have to figure out, how to create tables, figure out how it likes its schemas etc, to really give it a work out... Ok, I got the driver, and Im currently using it. Thanks. Now lets see what quirks I run into with odbc ;) -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] ODBC Database
Unless I am mistaken, but isn't there an ODBC driver available for MySQL called MyODBC? -- bob On Sun, 10 Aug 2003, Gerard Samuel wrote: > Larry E.Ullman wrote: > > >> Im looking at venturing into working with PHP's ODBC extention. > >> Does anyone have any recommendations as to a Database, that is easy to > >> understand/get into from a novice point of view, that installs on > >> windows 2k, > >> and is "free"? > > > > > > MySQL is kind of free, installs on W2K and is easy to use but it > > doesn't require PHP's ODBC extension since PHP already has a good > > MySQL extension. If you really want to use ODBC and you have MS > > Office, you could try Access. > > What Im doing is seeing if my code will run on different databases. > Of which it currently runs on mySQL, PostgreSQL and MSSQL. > As soon as I can get PHP5 installed Ill be checking out SQLLite. > But in the meantime, Im looking for a database that would interface with > ODBC. > I just downloaded IBM's DB2 Personal Edition, to see what I can do > there, but, > Im just looking for advice etc from others who went down this road. > > Thanks > > > -- > 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: [PHP-DB] ODBC Database
Im looking at venturing into working with PHP's ODBC extention. Does anyone have any recommendations as to a Database, that is easy to understand/get into from a novice point of view, that installs on windows 2k, and is "free"? MySQL is kind of free, installs on W2K and is easy to use but it doesn't require PHP's ODBC extension since PHP already has a good MySQL extension. If you really want to use ODBC and you have MS Office, you could try Access. Larry -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] ODBC equiv for mysql_insert_id
> I am connecting to MySQL (4.1) using ODBC (I have my reasons) and am looking > for an equivalent to the mysql_insert_id() function so that I can get the ID > of the record just created. You could always just issue a SELECT LAST_INSERT_ID() query and get the resulting number that way. ---John Holmes... -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] ODBC and error management
Nico, I'm using MyODBC to query MySQL (because my client want's it to work in Access, and I don't and this leaves the least amount of code to change). I don't get an error message if the result is empty (no records). I do a while loop and add to a counter and if the counter <1 then its empty otherwise I display the results. I do get the errors though when the query is 'bad' - contains errors. I'm running mine on both WinNT and Win2K with identical results. Hope this helps. George > -Original Message- > From: Nico Sabbi [mailto:[EMAIL PROTECTED] > Sent: 10 June 2003 12:01 pm > To: [EMAIL PROTECTED] > Subject: [PHP-DB] ODBC and error management > > > > > Hi, > > reading both the documentation and the MARC I found two serious > misbehaviours: > > 1) it seems that it's impossible to tell a query that is correct > but has no > records > from a query which is syntactically wrong (and consequently has > no records); > > or at least it seems to be impossibile to distinguish these two cases > without using odbc_num_rows, which is buggy itself > (because it loses in generality, so can't be used). > > 2) when using myodbc the string returned by odbc_errormsg() is always > non-sense: it doesn't contain > the real error msg returned by the db-server, but > > "unixODBC][MySQL][ODBC 3.51 Driver][mysqld-3.23.56-Max-log]Option value > changed to default static cursor" > > that obviously doesn't say anything useful. > > > Is there a way to workaround, or even better to solve, these problems? > > Thanks, > Nico > > > > > > > > > -- > 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: [PHP-DB] ODBC
No, that won't work. You need to create a system DSN. Here's what I did to create one. My PC is running Windows XP Professional and I am using Apache 1.3.27. * opened up the control panel * double-clicked Administrative Tools * double-clicked Data Sources (ODBC) * clicked on the System DSN tab * clicked Add... * selected Microsoft Access Driver (*.mdb) from the list * clicked Finish * typed mctadb in Data Source Name * clicked on Select... * selected the MS Access database I wanted to connect to and clicked OK * clicked on Advance... * typed in a Login name then clicked OK * clicked OK in the next 2 windows I could use some help as well. I get connected to the database but get an error when I try to execute a SQL statement on it. The error message I get is: Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in c:\program files\apache group\apache\htdocs\test2.php on line 30 cannot prepare result Does anyone know what might be missing? Here's the code from test2.php: $connection = odbc_connect("mctadb", "admin", "") || die("cannot open database"); $sql = "SELECT * FROM Meeting"; $result = odbc_exec($connection, $sql) || die("cannot prepare result"); -- Beverly Steiner [EMAIL PROTECTED] -Original Message- From: Kiswa [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 3:24 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] ODBC Hi. Is their anyway to connect to a Access Db using only the filesystem like $connect = odbc_connect("\Db\Webdb.mdb", "nobody", "nobody"); thus pointing directly to the file not using drivers??? -- 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: [PHP-DB] ODBC Timout for MS SQL Driver
Ok I tried this another way but using the ms sql functions along with: ini_set("mssql.timeout",2); ini_set("mssql.connect_timeout",2); ... no change, it still takes about 7-8 seconds to decide it couldn't connect. <>< Ryan -Original Message- From: Ryan Jameson (USA) Sent: Monday, March 03, 2003 11:01 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] ODBC Timout for MS SQL Driver Does anyone know a reliable way to set an ODBC connection to timeout after a very short time? I've tried set_time_limit but when the query is running PHP does not drop out, I've also tried odbc_setoption on the connection before executing. Basically, I want it to just fail quicker if it is going to. 30 seconds is too long. <>< Ryan Ryan Jameson Software Development Services Manager International Bible Society W (719) 867-2692 -- 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: [PHP-DB] odbc query with single quote in string
The 1st one didn't work, but the 2nd one did work. Fantastic! Thanks alot, you saved me from frustrations. Quoting "John W. Holmes" <[EMAIL PROTECTED]>: > > I'm having problem querying a table with a field value containing an > > appostropy, please help. Using ODBC to connect MSAcess database. > > > >$mQuery = "CustomerID='$mCust'"; > >$mCur2 = odbc_do( $mCnx, "select Login from Emails where $mQuery" > ); > > > > When it hits "O'Donald, James", I get error in odbc_exec(). I tried > > variations of $mQuery, including: > > > >$mQuery = addslashes( $mQuery ); > > You don't want to use addslashes() on $mQuery, you want to use it on the > data you're inserting between the quotes, i.e. $mCust. > > $mQuery = "CustomerID='" . addslashes($mCust) . "'"; > > If that still causes an error, your database may require quotes to be > escaped with another quote, instead of a backslash. In that case, you > can create a function like this > > function addslashes2($data) > { return str_replace("'","''",$data); } > > Hope that helps. > > ---John W. Holmes... > > PHP Architect - A monthly magazine for PHP Professionals. Get your copy > today. http://www.phparch.com/ > > > - This mail sent through ISOT. To find out more about ISOT, visit http://isot.com -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] odbc query with single quote in string
> I'm having problem querying a table with a field value containing an > appostropy, please help. Using ODBC to connect MSAcess database. > >$mQuery = "CustomerID='$mCust'"; >$mCur2 = odbc_do( $mCnx, "select Login from Emails where $mQuery" ); > > When it hits "O'Donald, James", I get error in odbc_exec(). I tried > variations of $mQuery, including: > >$mQuery = addslashes( $mQuery ); You don't want to use addslashes() on $mQuery, you want to use it on the data you're inserting between the quotes, i.e. $mCust. $mQuery = "CustomerID='" . addslashes($mCust) . "'"; If that still causes an error, your database may require quotes to be escaped with another quote, instead of a backslash. In that case, you can create a function like this function addslashes2($data) { return str_replace("'","''",$data); } Hope that helps. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] odbc connect problem
Hi Chip, Looks okay at first brush - I suspect your odbc.ini DSN config. Have you been able to test your DSN outside the PHP environment? e.g with the odbctest app that comes with iODBC? Can you post your odbc.ini / DSN info? > Warning: SQL error: [iODBC][Driver Manager]Specified driver could not be > loaded, SQL state IM003 in > SQLConnect in /usr/local/apache/htdocs/odbctest.php on line 16 My suspicions come from the test of this error - "could not be loaded" - so it's possible that your are specifying an invalid file, or there are permission issues on that file, etc.. either way, the contents of your odbc.ini might help. Cheers, Andrew -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] odbc connect problem
salamander <[EMAIL PROTECTED]> wrote on 08/09/2002 04:31:35 PM: > Chip, > I wonder if you set the ODBCINI environment variable with the putenv()? Yep, they are there and I am getting this error when attempting to load the web page - Warning: SQL error: [iODBC][Driver Manager]Specified driver could not be loaded, SQL state IM003 in SQLConnect in /usr/local/apache/htdocs/odbctest.php on line 16 Warning: odbc_exec(): supplied argument is not a valid ODBC-Link resource in /usr/local/apache/htdocs/odbctest.php on line 19 Warning: odbc_fetch_row(): supplied argument is not a valid ODBC result resource in /usr/local/apache/htdocs/odbctest.php on line 22 > If you could show the code in your odbctest.php file that would be > helpful. The output from /usr/local/bin/iodbc-odbctest [iodbc][driver manager]dialog failed, SQLSTATE=IM003 > Andrew Hill Below is the code of the odbctest.php file I am trying to use: Untitled Brand Part NumberDescription\n"; // fetch the succesive result rows while( odbc_fetch_row( $result ) ) { $brand= odbc_result( $result, 1 ); // get the field "ProductLineDescription" $number= odbc_result( $result, 2 ); // get the field "ItemNumber" $description= odbc_result( $result, 3 ); // get the field "ItemDescription" echo "$brand$number$description \n"; } echo ""; echo ""; ?> -- Chip > On Friday, August 9, 2002, at 07:31 PM, [EMAIL PROTECTED] wrote: > > > > Thanks, that fixed that part of it, now here's the newest error message: > > > > > > Warning: SQL error: [iODBC][Driver Manager]Specified driver could not be > > loaded, SQL > > state IM003 in SQLConnect in /usr/local/apache/htdocs/odbctest.php on > > line > > 7 > > > > Fatal error: Call to undefined function: error_handler() in > > /usr/local/apache/htdocs/odbctest.php > > on line 10 > > > > I'm outa here, catch up with ya on monday, > > > > -- > > Chip > > > > salamander <[EMAIL PROTECTED]> wrote on 08/09/2002 04:10:00 PM: > > > >> Chip, > > > >> You are going to have to rebuild the dso with the options you specified > >> before - try cutting and pasting the configure that shows up in your > >> phpinfo() to make it easier. > > > >> Also, you can get the necessary iODBC header files at www.iodbc.org, as > >> well as find a HOWTO there for compiling PHP/iODBC on *nix systems. > > > >> Cheers, > >> Andrew > > > >> On Friday, August 9, 2002, at 06:08 PM, [EMAIL PROTECTED] wrote: > > > >>> Yeah, you're right, I see I need to add --with-iodbc. Now another > >>> question > >>> - when I recompile to add > >>> this support, do I have to add all the other options that I originally > >>> had > >>> listed? Or can I add just this one > >>> and everything else will be left the same? What about php.ini? Will it > >>> be > >>> changed? > >>> > >>> -- > >>> Chip W > >>> > >>> Chip Atkinson <[EMAIL PROTECTED]> wrote on 08/09/2002 02:51:10 > > PM: > >>> > It looks like you didn't build php with odbc support. > Try putting in a call to > phpinfo (); > and see if it says that odbc support is compiled in. > >>> > (Another) Chip > >>> > On Fri, 9 Aug 2002 [EMAIL PROTECTED] wrote: > >>> > > I am attempting for the first time, to connect from > > freebsd/mysql/php > >>> box > > to a NT box running MAS200. I am able > > to connect from another NT workstation with Access and download > > data, > >>> so I > > am trying from FreeBSD now. > > When I run the code below I get error: > > > > Fatal error: Call to undefined function: odbc_connect() in > > /usr/local/apache/htdocs/odbctest.php on line 7 > > > > What am I doing wrong? There's not much info on this topic in the > > mysql > > manual. > > > > > > > > Untitled > > > > > > > $connect = odbc_connect("localhost", "", "-"); > > if (!$connect) > > { > >Error_handler( "Error in odbc_connect" , $connect ); > > } > > $result = odbc_exec($connect, "SELECT ProductLineDescription FROM > > IMA_ProductLine, ItemNumber, > > ItemDescription FROM IM1_InventoryMasterFile where DefaultWhse = > > 004"); > > if (!$result) { > > Error_handler( "Error in odbc_exec( no cursor returned ) " , > > $connect ); > > } > > echo "BrandPart > > NumberDescription\n"; > > > > // fetch the succesive result rows > > while( odbc_fetch_row( $result ) ) { > > $brand= odbc_result( $result, 1 ); // get the field > > "ProductLineDescription" > > $number= odbc_result( $result, 2 ); // get the field > >>> "ItemNumber" > > $description= odbc_result( $result, 3 ); // get the field > > "ItemDescription" > > > > > > echo > >>> "$brand$number$description > > \n"; > > } > > > > echo ""; > > echo ""; > > ?> > > > > -- > > Chip Wiegand > > Compute
Re: [PHP-DB] odbc connect problem
Chip, I wonder if you set the ODBCINI environment variable with the putenv()? If you could show the code in your odbctest.php file that would be helpful. Actually, I'll be traveling to Linuxworld on Monday - anyone wants to chat about ODBC who will be there feel free to drop me an email. Cheers, Andrew Hill OpenLink Software On Friday, August 9, 2002, at 07:31 PM, [EMAIL PROTECTED] wrote: > > Thanks, that fixed that part of it, now here's the newest error message: > > > Warning: SQL error: [iODBC][Driver Manager]Specified driver could not be > loaded, SQL > state IM003 in SQLConnect in /usr/local/apache/htdocs/odbctest.php on > line > 7 > > Fatal error: Call to undefined function: error_handler() in > /usr/local/apache/htdocs/odbctest.php > on line 10 > > I'm outa here, catch up with ya on monday, > > -- > Chip > > salamander <[EMAIL PROTECTED]> wrote on 08/09/2002 04:10:00 PM: > >> Chip, > >> You are going to have to rebuild the dso with the options you specified >> before - try cutting and pasting the configure that shows up in your >> phpinfo() to make it easier. > >> Also, you can get the necessary iODBC header files at www.iodbc.org, as >> well as find a HOWTO there for compiling PHP/iODBC on *nix systems. > >> Cheers, >> Andrew > >> On Friday, August 9, 2002, at 06:08 PM, [EMAIL PROTECTED] wrote: > >>> Yeah, you're right, I see I need to add --with-iodbc. Now another >>> question >>> - when I recompile to add >>> this support, do I have to add all the other options that I originally >>> had >>> listed? Or can I add just this one >>> and everything else will be left the same? What about php.ini? Will it >>> be >>> changed? >>> >>> -- >>> Chip W >>> >>> Chip Atkinson <[EMAIL PROTECTED]> wrote on 08/09/2002 02:51:10 > PM: >>> It looks like you didn't build php with odbc support. Try putting in a call to phpinfo (); and see if it says that odbc support is compiled in. >>> (Another) Chip >>> On Fri, 9 Aug 2002 [EMAIL PROTECTED] wrote: >>> > I am attempting for the first time, to connect from > freebsd/mysql/php >>> box > to a NT box running MAS200. I am able > to connect from another NT workstation with Access and download > data, >>> so I > am trying from FreeBSD now. > When I run the code below I get error: > > Fatal error: Call to undefined function: odbc_connect() in > /usr/local/apache/htdocs/odbctest.php on line 7 > > What am I doing wrong? There's not much info on this topic in the > mysql > manual. > > > > Untitled > > > $connect = odbc_connect("localhost", "", "-"); > if (!$connect) > { >Error_handler( "Error in odbc_connect" , $connect ); > } > $result = odbc_exec($connect, "SELECT ProductLineDescription FROM > IMA_ProductLine, ItemNumber, > ItemDescription FROM IM1_InventoryMasterFile where DefaultWhse = > 004"); > if (!$result) { > Error_handler( "Error in odbc_exec( no cursor returned ) " , > $connect ); > } > echo "BrandPart > NumberDescription\n"; > > // fetch the succesive result rows > while( odbc_fetch_row( $result ) ) { > $brand= odbc_result( $result, 1 ); // get the field > "ProductLineDescription" > $number= odbc_result( $result, 2 ); // get the field >>> "ItemNumber" > $description= odbc_result( $result, 3 ); // get the field > "ItemDescription" > > > echo >>> "$brand$number$description > \n"; > } > > echo ""; > echo ""; > ?> > > -- > Chip Wiegand > Computer Services > Simrad, Inc > www.simradusa.com > [EMAIL PROTECTED] > > "There is no reason anyone would want a computer in their home." > --Ken Olson, president, chairman and founder of Digital > Equipment > Corporation, 1977 > (They why do I have 9? Somebody help me!) > > > -- > 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 > > > -- > 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: [PHP-DB] odbc connect problem
Thanks, that fixed that part of it, now here's the newest error message: Warning: SQL error: [iODBC][Driver Manager]Specified driver could not be loaded, SQL state IM003 in SQLConnect in /usr/local/apache/htdocs/odbctest.php on line 7 Fatal error: Call to undefined function: error_handler() in /usr/local/apache/htdocs/odbctest.php on line 10 I'm outa here, catch up with ya on monday, -- Chip salamander <[EMAIL PROTECTED]> wrote on 08/09/2002 04:10:00 PM: > Chip, > You are going to have to rebuild the dso with the options you specified > before - try cutting and pasting the configure that shows up in your > phpinfo() to make it easier. > Also, you can get the necessary iODBC header files at www.iodbc.org, as > well as find a HOWTO there for compiling PHP/iODBC on *nix systems. > Cheers, > Andrew > On Friday, August 9, 2002, at 06:08 PM, [EMAIL PROTECTED] wrote: > > Yeah, you're right, I see I need to add --with-iodbc. Now another > > question > > - when I recompile to add > > this support, do I have to add all the other options that I originally > > had > > listed? Or can I add just this one > > and everything else will be left the same? What about php.ini? Will it > > be > > changed? > > > > -- > > Chip W > > > > Chip Atkinson <[EMAIL PROTECTED]> wrote on 08/09/2002 02:51:10 PM: > > > >> It looks like you didn't build php with odbc support. > >> Try putting in a call to > >> phpinfo (); > >> and see if it says that odbc support is compiled in. > > > >> (Another) Chip > > > >> On Fri, 9 Aug 2002 [EMAIL PROTECTED] wrote: > > > >>> I am attempting for the first time, to connect from freebsd/mysql/php > > box > >>> to a NT box running MAS200. I am able > >>> to connect from another NT workstation with Access and download data, > > so I > >>> am trying from FreeBSD now. > >>> When I run the code below I get error: > >>> > >>> Fatal error: Call to undefined function: odbc_connect() in > >>> /usr/local/apache/htdocs/odbctest.php on line 7 > >>> > >>> What am I doing wrong? There's not much info on this topic in the > >>> mysql > >>> manual. > >>> > >>> > >>> > >>> Untitled > >>> > >>> > >>> >>> $connect = odbc_connect("localhost", "", "-"); > >>> if (!$connect) > >>> { > >>>Error_handler( "Error in odbc_connect" , $connect ); > >>> } > >>> $result = odbc_exec($connect, "SELECT ProductLineDescription FROM > >>> IMA_ProductLine, ItemNumber, > >>> ItemDescription FROM IM1_InventoryMasterFile where DefaultWhse = > >>> 004"); > >>> if (!$result) { > >>> Error_handler( "Error in odbc_exec( no cursor returned ) " , > >>> $connect ); > >>> } > >>> echo "BrandPart > >>> NumberDescription\n"; > >>> > >>> // fetch the succesive result rows > >>> while( odbc_fetch_row( $result ) ) { > >>> $brand= odbc_result( $result, 1 ); // get the field > >>> "ProductLineDescription" > >>> $number= odbc_result( $result, 2 ); // get the field > > "ItemNumber" > >>> $description= odbc_result( $result, 3 ); // get the field > >>> "ItemDescription" > >>> > >>> > >>> echo > > "$brand$number$description > >>> \n"; > >>> } > >>> > >>> echo ""; > >>> echo ""; > >>> ?> > >>> > >>> -- > >>> Chip Wiegand > >>> Computer Services > >>> Simrad, Inc > >>> www.simradusa.com > >>> [EMAIL PROTECTED] > >>> > >>> "There is no reason anyone would want a computer in their home." > >>> --Ken Olson, president, chairman and founder of Digital Equipment > >>> Corporation, 1977 > >>> (They why do I have 9? Somebody help me!) > >>> > >>> > >>> -- > >>> 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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] odbc connect problem
Chip, You are going to have to rebuild the dso with the options you specified before - try cutting and pasting the configure that shows up in your phpinfo() to make it easier. Also, you can get the necessary iODBC header files at www.iodbc.org, as well as find a HOWTO there for compiling PHP/iODBC on *nix systems. Cheers, Andrew On Friday, August 9, 2002, at 06:08 PM, [EMAIL PROTECTED] wrote: > Yeah, you're right, I see I need to add --with-iodbc. Now another > question > - when I recompile to add > this support, do I have to add all the other options that I originally > had > listed? Or can I add just this one > and everything else will be left the same? What about php.ini? Will it > be > changed? > > -- > Chip W > > Chip Atkinson <[EMAIL PROTECTED]> wrote on 08/09/2002 02:51:10 PM: > >> It looks like you didn't build php with odbc support. >> Try putting in a call to >> phpinfo (); >> and see if it says that odbc support is compiled in. > >> (Another) Chip > >> On Fri, 9 Aug 2002 [EMAIL PROTECTED] wrote: > >>> I am attempting for the first time, to connect from freebsd/mysql/php > box >>> to a NT box running MAS200. I am able >>> to connect from another NT workstation with Access and download data, > so I >>> am trying from FreeBSD now. >>> When I run the code below I get error: >>> >>> Fatal error: Call to undefined function: odbc_connect() in >>> /usr/local/apache/htdocs/odbctest.php on line 7 >>> >>> What am I doing wrong? There's not much info on this topic in the >>> mysql >>> manual. >>> >>> >>> >>> Untitled >>> >>> >>> >> $connect = odbc_connect("localhost", "", "-"); >>> if (!$connect) >>> { >>>Error_handler( "Error in odbc_connect" , $connect ); >>> } >>> $result = odbc_exec($connect, "SELECT ProductLineDescription FROM >>> IMA_ProductLine, ItemNumber, >>> ItemDescription FROM IM1_InventoryMasterFile where DefaultWhse = >>> 004"); >>> if (!$result) { >>> Error_handler( "Error in odbc_exec( no cursor returned ) " , >>> $connect ); >>> } >>> echo "BrandPart >>> NumberDescription\n"; >>> >>> // fetch the succesive result rows >>> while( odbc_fetch_row( $result ) ) { >>> $brand= odbc_result( $result, 1 ); // get the field >>> "ProductLineDescription" >>> $number= odbc_result( $result, 2 ); // get the field > "ItemNumber" >>> $description= odbc_result( $result, 3 ); // get the field >>> "ItemDescription" >>> >>> >>> echo > "$brand$number$description >>> \n"; >>> } >>> >>> echo ""; >>> echo ""; >>> ?> >>> >>> -- >>> Chip Wiegand >>> Computer Services >>> Simrad, Inc >>> www.simradusa.com >>> [EMAIL PROTECTED] >>> >>> "There is no reason anyone would want a computer in their home." >>> --Ken Olson, president, chairman and founder of Digital Equipment >>> Corporation, 1977 >>> (They why do I have 9? Somebody help me!) >>> >>> >>> -- >>> 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: [PHP-DB] odbc connect problem
Yeah, you're right, I see I need to add --with-iodbc. Now another question - when I recompile to add this support, do I have to add all the other options that I originally had listed? Or can I add just this one and everything else will be left the same? What about php.ini? Will it be changed? -- Chip W Chip Atkinson <[EMAIL PROTECTED]> wrote on 08/09/2002 02:51:10 PM: > It looks like you didn't build php with odbc support. > Try putting in a call to > phpinfo (); > and see if it says that odbc support is compiled in. > (Another) Chip > On Fri, 9 Aug 2002 [EMAIL PROTECTED] wrote: > > I am attempting for the first time, to connect from freebsd/mysql/php box > > to a NT box running MAS200. I am able > > to connect from another NT workstation with Access and download data, so I > > am trying from FreeBSD now. > > When I run the code below I get error: > > > > Fatal error: Call to undefined function: odbc_connect() in > > /usr/local/apache/htdocs/odbctest.php on line 7 > > > > What am I doing wrong? There's not much info on this topic in the mysql > > manual. > > > > > > > > Untitled > > > > > > > $connect = odbc_connect("localhost", "", "-"); > > if (!$connect) > > { > >Error_handler( "Error in odbc_connect" , $connect ); > > } > > $result = odbc_exec($connect, "SELECT ProductLineDescription FROM > > IMA_ProductLine, ItemNumber, > > ItemDescription FROM IM1_InventoryMasterFile where DefaultWhse = 004"); > > if (!$result) { > > Error_handler( "Error in odbc_exec( no cursor returned ) " , > > $connect ); > > } > > echo "BrandPart > > NumberDescription\n"; > > > > // fetch the succesive result rows > > while( odbc_fetch_row( $result ) ) { > > $brand= odbc_result( $result, 1 ); // get the field > > "ProductLineDescription" > > $number= odbc_result( $result, 2 ); // get the field "ItemNumber" > > $description= odbc_result( $result, 3 ); // get the field > > "ItemDescription" > > > > > > echo "$brand$number$description > > \n"; > > } > > > > echo ""; > > echo ""; > > ?> > > > > -- > > Chip Wiegand > > Computer Services > > Simrad, Inc > > www.simradusa.com > > [EMAIL PROTECTED] > > > > "There is no reason anyone would want a computer in their home." > > --Ken Olson, president, chairman and founder of Digital Equipment > > Corporation, 1977 > > (They why do I have 9? Somebody help me!) > > > > > > -- > > 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: [PHP-DB] odbc connect problem
It looks like you didn't build php with odbc support. Try putting in a call to phpinfo (); and see if it says that odbc support is compiled in. (Another) Chip On Fri, 9 Aug 2002 [EMAIL PROTECTED] wrote: > I am attempting for the first time, to connect from freebsd/mysql/php box > to a NT box running MAS200. I am able > to connect from another NT workstation with Access and download data, so I > am trying from FreeBSD now. > When I run the code below I get error: > > Fatal error: Call to undefined function: odbc_connect() in > /usr/local/apache/htdocs/odbctest.php on line 7 > > What am I doing wrong? There's not much info on this topic in the mysql > manual. > > > > Untitled > > > $connect = odbc_connect("localhost", "", "-"); > if (!$connect) > { >Error_handler( "Error in odbc_connect" , $connect ); > } > $result = odbc_exec($connect, "SELECT ProductLineDescription FROM > IMA_ProductLine, ItemNumber, > ItemDescription FROM IM1_InventoryMasterFile where DefaultWhse = 004"); > if (!$result) { > Error_handler( "Error in odbc_exec( no cursor returned ) " , > $connect ); > } > echo "BrandPart > NumberDescription\n"; > > // fetch the succesive result rows > while( odbc_fetch_row( $result ) ) { > $brand= odbc_result( $result, 1 ); // get the field > "ProductLineDescription" > $number= odbc_result( $result, 2 ); // get the field "ItemNumber" > $description= odbc_result( $result, 3 ); // get the field > "ItemDescription" > > > echo "$brand$number$description > \n"; > } > > echo ""; > echo ""; > ?> > > -- > Chip Wiegand > Computer Services > Simrad, Inc > www.simradusa.com > [EMAIL PROTECTED] > > "There is no reason anyone would want a computer in their home." > --Ken Olson, president, chairman and founder of Digital Equipment > Corporation, 1977 > (They why do I have 9? Somebody help me!) > > > -- > 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: [PHP-DB] odbc and primary key
Jaz, http://www.php.net/manual/en/function.odbc-primarykeys.php Best regards, Andrew Hill On Wednesday, July 17, 2002, at 08:16 AM, j.a.z. wrote: > How can i get the information if a field on a database (in my case > Access2000) is primary key via a php-odbc-function? > or does i have to use sql for that? > thanx j.a.z. > > > > -- > 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: [PHP-DB] ODBC Remote
Try copying your .mdb to a new file and opening that one. I've seen this before. It really has nothing to do with PHP, it's a microsoft issue. <>< Ryan -Original Message- From: Juan Angel Ringhetti [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 2:08 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] ODBC Remote Hi, I have an app developed with PHP+Apache+MySQL on a NT Server, but I have data in a MSAccess file on a another LAN server (with NT) that I want to display. The response is always the same: Warning: SQL error: [Microsoft][Controlador ODBC Microsoft Access 97] The Microsoft Jet database engine cannot open the file '(desconocido)'. It is already opened exclusively by another user, or you need permission to view its data., SQL state S1000 in SQLConnect in file-example.php on line 15 I've been modified the permissions without succesfull. Anyone can help me? Thanks in advance Juan -- 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: [PHP-DB] ODBC problem in 4.2.0
Hi Ryan, Don't be hasty. What i'm simply saying is that QA is a process and you need to build feedback into the loop. Developers come and go in an Open Source development process and you need to build in regression tests so that when new developers with new ideas come along, they don't break code, or quickly realize what they have done after they have run basic regression tests. I also think that PHP developers are doing a fine job, but I don't think there is anything wrong in pointing out where they can improve, rather than apologize wholesale. Regards, John "Ryan Jameson" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... We will agree to disagree. I've experienced many testers who thought things that you think. They were often the most cocky and least effective of the hundreds I've worked with on projects, and again every product I've worked with from Microsoft to Oracle to Java have had similar issues arise. I think the PHP developers are doing a fine job, even if I do have to skip a release, I've got my money on this being fixed in the next release. <>< Ryan -Original Message- From: John Lim [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 30, 2002 2:50 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] ODBC problem in 4.2.0 Hi Ryan, It's not true that this can happen to any product. PHP is a fantastic language, but there are well-known ways to manage QA. All it needs is to include ODBC in the standard php regression test suite (and run the suite regularly!) Regards, John "Ryan Jameson" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... BTW... I'd just like to point out that this kind of thing is bound to happen no matter what product you use. I'm certain the PHP guys will have this solved in no time and I'd bet even they would recommend a commercial hosting service be willing and able to step back if a problem like this occurs. This is, however, just an opinion. -----Original Message- From: Ryan Jameson (USA) Sent: Monday, April 29, 2002 8:14 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] ODBC problem in 4.2.0 I'd recommend finding a hosting service that would be more careful about making upgrades. There seems to be some problems with ODBC in 4.2 and I have yet to hear of a work around, especially not one you can implement if you don't handle your own server. I feel your pain man! Fortunately for me I can just stay at 4.1.1 until there's a release that works. <>< Ryan -Original Message- From: Mihai Tache [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 7:11 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] ODBC problem in 4.2.0 i work on a website that runs on php with MSSQL through ODBC. until 4.2.0 everything was ok. but my hosting provider just upgraded to 4.2.0 the error message i get is : SQL error: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt, SQL state S1000 in SQLExecDirect in take the folowing code for example : the first odbc query runs OK but i get the error at the second one and ONLY if the first one returned more than one row. i even tried with 2 ODBC connections but doesn't work MS has something to say about this at http://support.microsoft.com/default.aspx?scid=kb;EN-US;q143032 don't know if that is really the problem or not. i don't know how i can set ODBC (from php) to be synchronous anyway. the fact is that the same scripts worked fine 6h ago on 4.1.1 and 4.0.6 (both on win32). i'd go back to 4.1.1 but i'm forced to work with 4.2.0 as i said is there something i can do except wait for 4.2.1 ? -- 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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP-DB] ODBC problem in 4.2.0
We will agree to disagree. I've experienced many testers who thought things that you think. They were often the most cocky and least effective of the hundreds I've worked with on projects, and again every product I've worked with from Microsoft to Oracle to Java have had similar issues arise. I think the PHP developers are doing a fine job, even if I do have to skip a release, I've got my money on this being fixed in the next release. <>< Ryan -Original Message- From: John Lim [mailto:[EMAIL PROTECTED]] Sent: Tuesday, April 30, 2002 2:50 AM To: [EMAIL PROTECTED] Subject: Re: [PHP-DB] ODBC problem in 4.2.0 Hi Ryan, It's not true that this can happen to any product. PHP is a fantastic language, but there are well-known ways to manage QA. All it needs is to include ODBC in the standard php regression test suite (and run the suite regularly!) Regards, John "Ryan Jameson" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... BTW... I'd just like to point out that this kind of thing is bound to happen no matter what product you use. I'm certain the PHP guys will have this solved in no time and I'd bet even they would recommend a commercial hosting service be willing and able to step back if a problem like this occurs. This is, however, just an opinion. -Original Message- From: Ryan Jameson (USA) Sent: Monday, April 29, 2002 8:14 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] ODBC problem in 4.2.0 I'd recommend finding a hosting service that would be more careful about making upgrades. There seems to be some problems with ODBC in 4.2 and I have yet to hear of a work around, especially not one you can implement if you don't handle your own server. I feel your pain man! Fortunately for me I can just stay at 4.1.1 until there's a release that works. <>< Ryan -Original Message- From: Mihai Tache [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 7:11 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] ODBC problem in 4.2.0 i work on a website that runs on php with MSSQL through ODBC. until 4.2.0 everything was ok. but my hosting provider just upgraded to 4.2.0 the error message i get is : SQL error: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt, SQL state S1000 in SQLExecDirect in take the folowing code for example : the first odbc query runs OK but i get the error at the second one and ONLY if the first one returned more than one row. i even tried with 2 ODBC connections but doesn't work MS has something to say about this at http://support.microsoft.com/default.aspx?scid=kb;EN-US;q143032 don't know if that is really the problem or not. i don't know how i can set ODBC (from php) to be synchronous anyway. the fact is that the same scripts worked fine 6h ago on 4.1.1 and 4.0.6 (both on win32). i'd go back to 4.1.1 but i'm forced to work with 4.2.0 as i said is there something i can do except wait for 4.2.1 ? -- 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 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] ODBC problem in 4.2.0
Hello, John Lim wrote: > Hi Ryan, > > It's not true that this can happen to any product. PHP is a fantastic > language, but > there are well-known ways to manage QA. All it needs is to include ODBC > in the standard php regression test suite (and run the suite regularly!) This is not the case of a bug but rather an intentional and documented backwards incompatible change of odbc_fecth_row function. I think that is very unprofessional from the PHP developers that did it and approve it and it is not the first time they do it with this and other PHP function. Unfortunately there is an odd conception of them that if you break backwards compatibility and document it that is ok, which I completely disagree, especially because this was not a X.0 version. Unlike with a real company, since there is no commercial harm for the PHP developers responsible for breaking backwards compatibility it is pointless to complain about lack of professionalism of the responsible PHP developers, as it was demonstrated in the episodes when they broke functions that worked consistently for 4 years like dirname and strtok. The only way to solve people's problem with these functions is use PHP code that uses conditional programming based on the PHP version that is running. Regards, Manuel Lemos > > Regards, John > > "Ryan Jameson" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > BTW... I'd just like to point out that this kind of thing is bound to happen > no matter what product you use. I'm certain the PHP guys will have this > solved in no time and I'd bet even they would recommend a commercial hosting > service be willing and able to step back if a problem like this occurs. This > is, however, just an opinion. > > -Original Message- > From: Ryan Jameson (USA) > Sent: Monday, April 29, 2002 8:14 PM > To: [EMAIL PROTECTED] > Subject: RE: [PHP-DB] ODBC problem in 4.2.0 > > > > I'd recommend finding a hosting service that would be more careful about > making upgrades. There seems to be some problems with ODBC in 4.2 and I have > yet to hear of a work around, especially not one you can implement if you > don't handle your own server. I feel your pain man! Fortunately for me I can > just stay at 4.1.1 until there's a release that works. > > <>< Ryan > > > -Original Message- > From: Mihai Tache [mailto:[EMAIL PROTECTED]] > Sent: Monday, April 29, 2002 7:11 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] ODBC problem in 4.2.0 > > > i work on a website that runs on php with MSSQL through ODBC. > until 4.2.0 everything was ok. but my hosting provider just upgraded to > 4.2.0 > the error message i get is : > > SQL error: [Microsoft][ODBC SQL Server Driver]Connection is busy with > results for another hstmt, SQL state S1000 in SQLExecDirect in > > take the folowing code for example : > > $res=odbc_exec($conn,"select * from ..."); > for($i=1;odbc_fetch_row($res);$i++) > { > $res2=odbc_exec($conn,"select * from "); > ... > } > ?> > > the first odbc query runs OK but i get the error at the second one and ONLY > if the first one returned more than one row. > i even tried with 2 ODBC connections but doesn't work > MS has something to say about this at > http://support.microsoft.com/default.aspx?scid=kb;EN-US;q143032 > don't know if that is really the problem or not. i don't know how i can set > ODBC (from php) to be synchronous anyway. > the fact is that the same scripts worked fine 6h ago on 4.1.1 and 4.0.6 > (both on win32). > i'd go back to 4.1.1 but i'm forced to work with 4.2.0 as i said > is there something i can do except wait for 4.2.1 ? > > > > > -- > 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: [PHP-DB] ODBC problem in 4.2.0
Hi Ryan, It's not true that this can happen to any product. PHP is a fantastic language, but there are well-known ways to manage QA. All it needs is to include ODBC in the standard php regression test suite (and run the suite regularly!) Regards, John "Ryan Jameson" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... BTW... I'd just like to point out that this kind of thing is bound to happen no matter what product you use. I'm certain the PHP guys will have this solved in no time and I'd bet even they would recommend a commercial hosting service be willing and able to step back if a problem like this occurs. This is, however, just an opinion. -Original Message- From: Ryan Jameson (USA) Sent: Monday, April 29, 2002 8:14 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] ODBC problem in 4.2.0 I'd recommend finding a hosting service that would be more careful about making upgrades. There seems to be some problems with ODBC in 4.2 and I have yet to hear of a work around, especially not one you can implement if you don't handle your own server. I feel your pain man! Fortunately for me I can just stay at 4.1.1 until there's a release that works. <>< Ryan -Original Message- From: Mihai Tache [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 7:11 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] ODBC problem in 4.2.0 i work on a website that runs on php with MSSQL through ODBC. until 4.2.0 everything was ok. but my hosting provider just upgraded to 4.2.0 the error message i get is : SQL error: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt, SQL state S1000 in SQLExecDirect in take the folowing code for example : the first odbc query runs OK but i get the error at the second one and ONLY if the first one returned more than one row. i even tried with 2 ODBC connections but doesn't work MS has something to say about this at http://support.microsoft.com/default.aspx?scid=kb;EN-US;q143032 don't know if that is really the problem or not. i don't know how i can set ODBC (from php) to be synchronous anyway. the fact is that the same scripts worked fine 6h ago on 4.1.1 and 4.0.6 (both on win32). i'd go back to 4.1.1 but i'm forced to work with 4.2.0 as i said is there something i can do except wait for 4.2.1 ? -- 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: [PHP-DB] ODBC problem in 4.2.0
BTW... I'd just like to point out that this kind of thing is bound to happen no matter what product you use. I'm certain the PHP guys will have this solved in no time and I'd bet even they would recommend a commercial hosting service be willing and able to step back if a problem like this occurs. This is, however, just an opinion. -Original Message- From: Ryan Jameson (USA) Sent: Monday, April 29, 2002 8:14 PM To: [EMAIL PROTECTED] Subject: RE: [PHP-DB] ODBC problem in 4.2.0 I'd recommend finding a hosting service that would be more careful about making upgrades. There seems to be some problems with ODBC in 4.2 and I have yet to hear of a work around, especially not one you can implement if you don't handle your own server. I feel your pain man! Fortunately for me I can just stay at 4.1.1 until there's a release that works. <>< Ryan -Original Message- From: Mihai Tache [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 7:11 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] ODBC problem in 4.2.0 i work on a website that runs on php with MSSQL through ODBC. until 4.2.0 everything was ok. but my hosting provider just upgraded to 4.2.0 the error message i get is : SQL error: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt, SQL state S1000 in SQLExecDirect in take the folowing code for example : the first odbc query runs OK but i get the error at the second one and ONLY if the first one returned more than one row. i even tried with 2 ODBC connections but doesn't work MS has something to say about this at http://support.microsoft.com/default.aspx?scid=kb;EN-US;q143032 don't know if that is really the problem or not. i don't know how i can set ODBC (from php) to be synchronous anyway. the fact is that the same scripts worked fine 6h ago on 4.1.1 and 4.0.6 (both on win32). i'd go back to 4.1.1 but i'm forced to work with 4.2.0 as i said is there something i can do except wait for 4.2.1 ? -- 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: [PHP-DB] ODBC problem in 4.2.0
I'd recommend finding a hosting service that would be more careful about making upgrades. There seems to be some problems with ODBC in 4.2 and I have yet to hear of a work around, especially not one you can implement if you don't handle your own server. I feel your pain man! Fortunately for me I can just stay at 4.1.1 until there's a release that works. <>< Ryan -Original Message- From: Mihai Tache [mailto:[EMAIL PROTECTED]] Sent: Monday, April 29, 2002 7:11 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] ODBC problem in 4.2.0 i work on a website that runs on php with MSSQL through ODBC. until 4.2.0 everything was ok. but my hosting provider just upgraded to 4.2.0 the error message i get is : SQL error: [Microsoft][ODBC SQL Server Driver]Connection is busy with results for another hstmt, SQL state S1000 in SQLExecDirect in take the folowing code for example : the first odbc query runs OK but i get the error at the second one and ONLY if the first one returned more than one row. i even tried with 2 ODBC connections but doesn't work MS has something to say about this at http://support.microsoft.com/default.aspx?scid=kb;EN-US;q143032 don't know if that is really the problem or not. i don't know how i can set ODBC (from php) to be synchronous anyway. the fact is that the same scripts worked fine 6h ago on 4.1.1 and 4.0.6 (both on win32). i'd go back to 4.1.1 but i'm forced to work with 4.2.0 as i said is there something i can do except wait for 4.2.1 ? -- 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: [PHP-DB] ODBC -- Setting ApplicationID
I think that work-around may work for me. Since I can declare a different environment variable for the PHP script, with a new alias, that should work fine. Thanks for the suggestion. - Bruce Andrew Hill wrote: > Bruce, > > It looks like you were on the right track initially, the problem is that PHP > has a major bug - odbc_setoption is coded specific to ODBC statement handle > (connection id), which means that trying to use odbc_setoption the way you > want attempts to set a SQLSetConnectOption AFTER the connection is open - > which is bogus and will give you ODBC function sequence errors. > > On the other hand, the error message you were getting is a bit misleading; > we are fixing that now. > > So... you can unfortunately not do this via Application ID, but since you > are using the OpenLink Rules Book, you can still affect Session-based > connection management with any of the other connection criteria: > > Here is one way to do it: > -- > Setup your session attributes by configuring the Session Rules Book Aliases > section of the Multi-Tier OpenLink Admin Assistant. > (http://servername:8000). > > You can configure session rules for any combination of Domain, Database, > User, Operating System, Client Machine, Client Application, etc., and can > control any connection options at the server side based on the session. > > Using "Database" as an example, add a Database Alias with a new database > name and configure a session mapping rule to point to the original database > name, but change the connection attributes from "Read / Write" to "Read > Only" in the options for the connection session. > > On the PHP side, simply choose between two DSN's in the odbc.ini - one is > the "normal" DSN, with default settings, and one will have an alternate > database name, "name_readonly" or somesuch, that will cause the oplrqb to > instantiate the appropriate connection attributes. > > If you run into problems, you should probably open a support case at > http://www.openlinksw.com/support/suppindx.htm, as this is getting somewhat > off-topic for PHP. > > Hope this helps! > > Best regards, > Andrew Hill > Director of Technology Evangelism > OpenLink Software http://www.openlinksw.com > Universal Data Access & Data Integration Technology Providers > > I was thinking of using the usernames, but as people come and go, that might > mean messing around with the oplrqb.ini file too much. I'd really like to > do > this based on application. What variable do I pass with the PHP script? > ( I'm > not sure what you mean ). Can I use a variable in PHP that passes the > application name to the server? > > Thanks, > > Bruce > > Andrew Hill wrote: > > > Hi Bruce, > > > > The setoption error is being thrown because you cannot use > > SQLSetConnectOption that way. > > Passing arbitrary info to be used by your application isn't really what > this > > is for, but instead can be used to modify parameters in the ODBC API. > > > > This means you can modify things like SQL_ACCESS_MODE, SQL_AUTOCOMMIT, > > SQL_ODBC_CURSORS, etc., (check the 2.x spec - there are several metadata > > items that you can control with this API call.) > > > > I'd recommend you just pass a variable to your PHP script, and perhaps > > change the username to a read-only/read-write user with a case statement > or > > somesuch, based on the application. > > > > Again, I'd strongly recommend you upgrade the OpenLink UDA version as > well; > > 1.5 is something like 5 years old or more. > > > > Best regards, > > Andrew Hill > > Director of Technology Evangelism > > http://www.openlinksw.com/virtuoso/whatis.htm > > OpenLink Virtuoso Internet Data Integration Server > > > > > -Original Message- > > > From: Bruce S. Garlock [mailto:[EMAIL PROTECTED]] > > > Sent: Monday, March 25, 2002 10:48 AM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [PHP-DB] ODBC -- Setting ApplicationID > > > > > > > > > Sure, I'm simply trying to have PHP pass an ApplicationID to the > > > ODBC server. > > > When a PHP script access the ODBC database, it does not set the > > > application: > > > > > > 10:46:04 connectopts= user=webuser opsys=unix machine=linux > application= > > > > > > As you can see, application= is NULL. I would like the script to pass > > > something, so that my mapping rules on the server would allow > > > write access to > > >
RE: [PHP-DB] ODBC -- Setting ApplicationID
Bruce, It looks like you were on the right track initially, the problem is that PHP has a major bug - odbc_setoption is coded specific to ODBC statement handle (connection id), which means that trying to use odbc_setoption the way you want attempts to set a SQLSetConnectOption AFTER the connection is open - which is bogus and will give you ODBC function sequence errors. On the other hand, the error message you were getting is a bit misleading; we are fixing that now. So... you can unfortunately not do this via Application ID, but since you are using the OpenLink Rules Book, you can still affect Session-based connection management with any of the other connection criteria: Here is one way to do it: -- Setup your session attributes by configuring the Session Rules Book Aliases section of the Multi-Tier OpenLink Admin Assistant. (http://servername:8000). You can configure session rules for any combination of Domain, Database, User, Operating System, Client Machine, Client Application, etc., and can control any connection options at the server side based on the session. Using "Database" as an example, add a Database Alias with a new database name and configure a session mapping rule to point to the original database name, but change the connection attributes from "Read / Write" to "Read Only" in the options for the connection session. On the PHP side, simply choose between two DSN's in the odbc.ini - one is the "normal" DSN, with default settings, and one will have an alternate database name, "name_readonly" or somesuch, that will cause the oplrqb to instantiate the appropriate connection attributes. If you run into problems, you should probably open a support case at http://www.openlinksw.com/support/suppindx.htm, as this is getting somewhat off-topic for PHP. Hope this helps! Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers I was thinking of using the usernames, but as people come and go, that might mean messing around with the oplrqb.ini file too much. I'd really like to do this based on application. What variable do I pass with the PHP script? ( I'm not sure what you mean ). Can I use a variable in PHP that passes the application name to the server? Thanks, Bruce Andrew Hill wrote: > Hi Bruce, > > The setoption error is being thrown because you cannot use > SQLSetConnectOption that way. > Passing arbitrary info to be used by your application isn't really what this > is for, but instead can be used to modify parameters in the ODBC API. > > This means you can modify things like SQL_ACCESS_MODE, SQL_AUTOCOMMIT, > SQL_ODBC_CURSORS, etc., (check the 2.x spec - there are several metadata > items that you can control with this API call.) > > I'd recommend you just pass a variable to your PHP script, and perhaps > change the username to a read-only/read-write user with a case statement or > somesuch, based on the application. > > Again, I'd strongly recommend you upgrade the OpenLink UDA version as well; > 1.5 is something like 5 years old or more. > > Best regards, > Andrew Hill > Director of Technology Evangelism > http://www.openlinksw.com/virtuoso/whatis.htm > OpenLink Virtuoso Internet Data Integration Server > > > -----Original Message- > > From: Bruce S. Garlock [mailto:[EMAIL PROTECTED]] > > Sent: Monday, March 25, 2002 10:48 AM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP-DB] ODBC -- Setting ApplicationID > > > > > > Sure, I'm simply trying to have PHP pass an ApplicationID to the > > ODBC server. > > When a PHP script access the ODBC database, it does not set the > > application: > > > > 10:46:04 connectopts= user=webuser opsys=unix machine=linux application= > > > > As you can see, application= is NULL. I would like the script to pass > > something, so that my mapping rules on the server would allow > > write access to > > the db, if the PHP application sends a certain name. Currently our Win32 > > applications, like MS Access, send application names. e.g. Access, sends: > > application=MSACCESS. > > > > Thanks for your help, > > > > Bruce > > > > Andrew Hill wrote: > > > > > Bruce, > > > > > > I'm not sure what you are trying to do - could you clarify? > > > You may be able to simply use the OpenLink Rules Book to set role-based > > > authentication on domain, ip, application, etc. > > > > > > Also, the ODBC Driver version (1.5) you are using is _very_ old and > > > unsupported. > > > I suggest you upgrade to
Re: [PHP-DB] ODBC -- Setting ApplicationID
I was thinking of using the usernames, but as people come and go, that might mean messing around with the oplrqb.ini file too much. I'd really like to do this based on application. What variable do I pass with the PHP script? ( I'm not sure what you mean ). Can I use a variable in PHP that passes the application name to the server? Thanks, Bruce Andrew Hill wrote: > Hi Bruce, > > The setoption error is being thrown because you cannot use > SQLSetConnectOption that way. > Passing arbitrary info to be used by your application isn't really what this > is for, but instead can be used to modify parameters in the ODBC API. > > This means you can modify things like SQL_ACCESS_MODE, SQL_AUTOCOMMIT, > SQL_ODBC_CURSORS, etc., (check the 2.x spec - there are several metadata > items that you can control with this API call.) > > I'd recommend you just pass a variable to your PHP script, and perhaps > change the username to a read-only/read-write user with a case statement or > somesuch, based on the application. > > Again, I'd strongly recommend you upgrade the OpenLink UDA version as well; > 1.5 is something like 5 years old or more. > > Best regards, > Andrew Hill > Director of Technology Evangelism > http://www.openlinksw.com/virtuoso/whatis.htm > OpenLink Virtuoso Internet Data Integration Server > > > -Original Message- > > From: Bruce S. Garlock [mailto:[EMAIL PROTECTED]] > > Sent: Monday, March 25, 2002 10:48 AM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP-DB] ODBC -- Setting ApplicationID > > > > > > Sure, I'm simply trying to have PHP pass an ApplicationID to the > > ODBC server. > > When a PHP script access the ODBC database, it does not set the > > application: > > > > 10:46:04 connectopts= user=webuser opsys=unix machine=linux application= > > > > As you can see, application= is NULL. I would like the script to pass > > something, so that my mapping rules on the server would allow > > write access to > > the db, if the PHP application sends a certain name. Currently our Win32 > > applications, like MS Access, send application names. e.g. Access, sends: > > application=MSACCESS. > > > > Thanks for your help, > > > > Bruce > > > > Andrew Hill wrote: > > > > > Bruce, > > > > > > I'm not sure what you are trying to do - could you clarify? > > > You may be able to simply use the OpenLink Rules Book to set role-based > > > authentication on domain, ip, application, etc. > > > > > > Also, the ODBC Driver version (1.5) you are using is _very_ old and > > > unsupported. > > > I suggest you upgrade to 4.2 > > > > > > Best regards, > > > Andrew Hill > > > Director of Technology Evangelism > > > OpenLink Software http://www.openlinksw.com > > > Universal Data Access & Data Integration Technology Providers > > > > > > > -Original Message- > > > > From: Bruce S. Garlock [mailto:[EMAIL PROTECTED]] > > > > Sent: Thursday, March 21, 2002 11:02 AM > > > > To: [EMAIL PROTECTED] > > > > Subject: [PHP-DB] ODBC -- Setting ApplicationID > > > > > > > > > > > > I am trying to set the ApplicationID, when connecting to an ODBC > > > > datasource. I have tried: > > > > > > > > odbc_setoption ($conn, 1, 1053, "PHPAPP"); > > > > > > > > And get a: > > > > > > > > "SQL error: [iODBC][Driver Manager]Option type out of range, SQL state > > > > S1092 in SetConnectOption" > > > > > > > > Basically, I want my PHP script to pass the application name > > to the ODBC > > > > server, so that I can set up a mapping on the server that allows write > > > > access when a certain application string is sent. > > > > > > > > PHP 4.06 (with file-upload patch) > > > > Openlink ODBC 1.5 > > > > Linux Client > > > > SCO Informix 5 server > > > > > > > > > > > > TIA- > > > > > > > > Bruce > > > > > > > > > > > > > > > > > > > > -- > > > > 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: [PHP-DB] ODBC -- Setting ApplicationID
Hi Bruce, The setoption error is being thrown because you cannot use SQLSetConnectOption that way. Passing arbitrary info to be used by your application isn't really what this is for, but instead can be used to modify parameters in the ODBC API. This means you can modify things like SQL_ACCESS_MODE, SQL_AUTOCOMMIT, SQL_ODBC_CURSORS, etc., (check the 2.x spec - there are several metadata items that you can control with this API call.) I'd recommend you just pass a variable to your PHP script, and perhaps change the username to a read-only/read-write user with a case statement or somesuch, based on the application. Again, I'd strongly recommend you upgrade the OpenLink UDA version as well; 1.5 is something like 5 years old or more. Best regards, Andrew Hill Director of Technology Evangelism http://www.openlinksw.com/virtuoso/whatis.htm OpenLink Virtuoso Internet Data Integration Server > -Original Message- > From: Bruce S. Garlock [mailto:[EMAIL PROTECTED]] > Sent: Monday, March 25, 2002 10:48 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] ODBC -- Setting ApplicationID > > > Sure, I'm simply trying to have PHP pass an ApplicationID to the > ODBC server. > When a PHP script access the ODBC database, it does not set the > application: > > 10:46:04 connectopts= user=webuser opsys=unix machine=linux application= > > As you can see, application= is NULL. I would like the script to pass > something, so that my mapping rules on the server would allow > write access to > the db, if the PHP application sends a certain name. Currently our Win32 > applications, like MS Access, send application names. e.g. Access, sends: > application=MSACCESS. > > Thanks for your help, > > Bruce > > Andrew Hill wrote: > > > Bruce, > > > > I'm not sure what you are trying to do - could you clarify? > > You may be able to simply use the OpenLink Rules Book to set role-based > > authentication on domain, ip, application, etc. > > > > Also, the ODBC Driver version (1.5) you are using is _very_ old and > > unsupported. > > I suggest you upgrade to 4.2 > > > > Best regards, > > Andrew Hill > > Director of Technology Evangelism > > OpenLink Software http://www.openlinksw.com > > Universal Data Access & Data Integration Technology Providers > > > > > -Original Message- > > > From: Bruce S. Garlock [mailto:[EMAIL PROTECTED]] > > > Sent: Thursday, March 21, 2002 11:02 AM > > > To: [EMAIL PROTECTED] > > > Subject: [PHP-DB] ODBC -- Setting ApplicationID > > > > > > > > > I am trying to set the ApplicationID, when connecting to an ODBC > > > datasource. I have tried: > > > > > > odbc_setoption ($conn, 1, 1053, "PHPAPP"); > > > > > > And get a: > > > > > > "SQL error: [iODBC][Driver Manager]Option type out of range, SQL state > > > S1092 in SetConnectOption" > > > > > > Basically, I want my PHP script to pass the application name > to the ODBC > > > server, so that I can set up a mapping on the server that allows write > > > access when a certain application string is sent. > > > > > > PHP 4.06 (with file-upload patch) > > > Openlink ODBC 1.5 > > > Linux Client > > > SCO Informix 5 server > > > > > > > > > TIA- > > > > > > Bruce > > > > > > > > > > > > > > > -- > > > 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: [PHP-DB] ODBC -- Setting ApplicationID
Sure, I'm simply trying to have PHP pass an ApplicationID to the ODBC server. When a PHP script access the ODBC database, it does not set the application: 10:46:04 connectopts= user=webuser opsys=unix machine=linux application= As you can see, application= is NULL. I would like the script to pass something, so that my mapping rules on the server would allow write access to the db, if the PHP application sends a certain name. Currently our Win32 applications, like MS Access, send application names. e.g. Access, sends: application=MSACCESS. Thanks for your help, Bruce Andrew Hill wrote: > Bruce, > > I'm not sure what you are trying to do - could you clarify? > You may be able to simply use the OpenLink Rules Book to set role-based > authentication on domain, ip, application, etc. > > Also, the ODBC Driver version (1.5) you are using is _very_ old and > unsupported. > I suggest you upgrade to 4.2 > > Best regards, > Andrew Hill > Director of Technology Evangelism > OpenLink Software http://www.openlinksw.com > Universal Data Access & Data Integration Technology Providers > > > -Original Message- > > From: Bruce S. Garlock [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, March 21, 2002 11:02 AM > > To: [EMAIL PROTECTED] > > Subject: [PHP-DB] ODBC -- Setting ApplicationID > > > > > > I am trying to set the ApplicationID, when connecting to an ODBC > > datasource. I have tried: > > > > odbc_setoption ($conn, 1, 1053, "PHPAPP"); > > > > And get a: > > > > "SQL error: [iODBC][Driver Manager]Option type out of range, SQL state > > S1092 in SetConnectOption" > > > > Basically, I want my PHP script to pass the application name to the ODBC > > server, so that I can set up a mapping on the server that allows write > > access when a certain application string is sent. > > > > PHP 4.06 (with file-upload patch) > > Openlink ODBC 1.5 > > Linux Client > > SCO Informix 5 server > > > > > > TIA- > > > > Bruce > > > > > > > > > > -- > > 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: [PHP-DB] ODBC -- Setting ApplicationID
Bruce, I'm not sure what you are trying to do - could you clarify? You may be able to simply use the OpenLink Rules Book to set role-based authentication on domain, ip, application, etc. Also, the ODBC Driver version (1.5) you are using is _very_ old and unsupported. I suggest you upgrade to 4.2 Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: Bruce S. Garlock [mailto:[EMAIL PROTECTED]] > Sent: Thursday, March 21, 2002 11:02 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] ODBC -- Setting ApplicationID > > > I am trying to set the ApplicationID, when connecting to an ODBC > datasource. I have tried: > > odbc_setoption ($conn, 1, 1053, "PHPAPP"); > > And get a: > > "SQL error: [iODBC][Driver Manager]Option type out of range, SQL state > S1092 in SetConnectOption" > > Basically, I want my PHP script to pass the application name to the ODBC > server, so that I can set up a mapping on the server that allows write > access when a certain application string is sent. > > PHP 4.06 (with file-upload patch) > Openlink ODBC 1.5 > Linux Client > SCO Informix 5 server > > > TIA- > > Bruce > > > > > -- > 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: [PHP-DB] odbc functions
Richard, Simple example using MS SQL Server: Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: Richard Black [mailto:[EMAIL PROTECTED]] > Sent: Monday, February 04, 2002 10:36 AM > To: '[EMAIL PROTECTED]' > Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]' > Subject: [PHP-DB] odbc functions > > > Does anyone have experience of using odbc_primarykeys??? > > I'm writing a script to let me port a database from Access to > MySQL without > having to write all the table definitions by hand. But I can't get > odbc_primarykeys to work - it comes back with: > > Warning: SQL error: , SQL state 0 in SQLPrimaryKeys > > I don't really know what the modifier and owner parameters should do, and > suspect thats where the problem lies. I tried them as "", "%" and " ". > > Running PHP 4.0.4 on NT 4.0 Workstation, with Access 97 > > Richy. > > > == > Richard Black > Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com > Tel: 0141 435 3504 > Email: [EMAIL PROTECTED] > > > -- > 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: [PHP-DB] ODBC
Morten, ODBC stands for "Open Database Connectivity". It's a connection layer (API) that is non-database-specific. This removes application dependence on one particular database, e.g. using ODBC instead of "native" functions allows you to write your application against MySQL and then deploy on Oracle, for instance. On Linux and other *nix flavors, connecting to databases with ODBC using PHP requires that PHP be compiled with an ODBC Driver Manager, and that ODBC Drivers be installed. A HOWTO is available at www.iodbc.org as well as an Open Source Driver Manager and free commercial driver downloads. On Windows, only drivers need to be installed, as the Driver Manager is present (MDAC or ODBC Administrator) and PHP builds for Windows can use this by default. Hope this helps! Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers office:781.273.0900 x 27 mobile:781.608.4217 > -Original Message- > From: Morten Nielsen [mailto:[EMAIL PROTECTED]] > Sent: Saturday, February 02, 2002 11:45 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] ODBC > > > Hi, > > Could anybody explain to me what ODBC is. Should I install it when I use > mySQL? > > Thanks, > Morten > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP-DB] ODBC
From Windows Help: You can use Data Sources Open Database Connectivity (ODBC) to access data from a variety of database management systems. For example, if you have a program that accesses data in a SQL database, Data Sources (ODBC) will let you use the same program to access data in a Visual FoxPro database. To do this, you must add software components called drivers to your system. Data Sources (ODBC) helps you add and configure these drivers. The only thing you'll really need ODBC for on Windows with PHP is to work with an Access database, but why would you want to when MySQL and SQL Server are faster? Mike > - Original Message - > From: "Morten Nielsen" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Saturday, February 02, 2002 8:42 AM > Subject: [PHP-DB] ODBC > > > > Hi, > > Could anybody explain to me what ODBC is. Should I install it with mySQL. > > > > Thanks, > > Morten > > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] ODBC
>From Windows Help: You can use Data Sources Open Database Connectivity (ODBC) to access data from a variety of database management systems. For example, if you have a program that accesses data in a SQL database, Data Sources (ODBC) will let you use the same program to access data in a Visual FoxPro database. To do this, you must add software components called drivers to your system. Data Sources (ODBC) helps you add and configure these drivers. The only thing you'll really need ODBC for on Windows with PHP is to work with an Access database, but why would you want to when MySQL and SQL Server are faster? Mike - Original Message - From: "Morten Nielsen" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, February 02, 2002 8:42 AM Subject: [PHP-DB] ODBC > Hi, > Could anybody explain to me what ODBC is. Should I install it with mySQL. > > Thanks, > Morten > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] odbc and access
Sam, If this is Windows, ensure you are using a System DSN. If this is *nix, ensure you have an ODBC driver installed and the odbc.ini file pointed to via a putenv(). Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: Berthelot [mailto:[EMAIL PROTECTED]] > Sent: Monday, January 07, 2002 11:57 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] odbc and access > > > I want to connect to an access database via a dsn. > Here is the code: > > $db_link = odbc_connect("tatoo", "", ""); > ?> > And I got the following error: > Warning: SQL error: [Microsoft][Gestionnaire de pilotes ODBC] Source de > données introuvable et nom de pilote non spécifié, SQL state IM002 in > SQLConnect in C:\Inetpub\wwwroot\php\first.php on line 11 > > I know it's written in french... sorry: that mean that the driver manager > can't find the data source but my dsn is correct. > Anyone can help me ? > thanx. > sam > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] odbc date
date() use a timestamp. I receive a string. if I echo odbc_result($cursor,"date") it shows like "2001-11-21 00:00". Can it echo (without date() function because I don't receive a timestamp) "21 Nov 2001"? -- Best regards, George Nicolae IT Manager ___ X-Playin - Professional Web Design www.x-playin.f2s.com "Andrew Hill" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > George, > > Yes, using the date() example. > > Cheers, > Andrew > > > > -Original Message- > > From: George Nicolae [mailto:[EMAIL PROTECTED]] > > Sent: Monday, December 31, 2001 1:26 PM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP-DB] odbc date > > > > > > it is right but I want to select all data from a mdbdatabase table and I > > receive in '/mm/dd hh:mm:ss' format. > > I told you I resolve this problem with date("F j, > > Y",strtotime(odbc_result($cur,"date"))). > > I what to know if I can receive a specific format from query "select date > > from my_table" > > > > -- > > > > > > Best regards, > > George Nicolae > > IT Manager > > ___ > > X-Playin - Professional Web Design > > www.x-playin.f2s.com > > > > > > > > "Andrew Hill" <[EMAIL PROTECTED]> wrote in message > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > > George, > > > > > > The ODBC date syntax is best used for to make input format unambiguous, > > > e.g.: > > > > > > select * from orders where order_date = { d '2002-01-01'} > > > This will allow you to select from a table regardless of the > > date format. > > > > > > For converting a date from one format to another, select it from a table > > and > > > then use the PHP date() function to convert, e.g.: > > > > > > while (list ($timestamp) = each ($result_array)) > > > { > > > $new_format = date(Y-m-d, $timestamp); > > > echo "$new_format"; > > > } > > > > > > Best regards, > > > Andrew Hill > > > Director of Technology Evangelism > > > OpenLink Software http://www.openlinksw.com > > > Universal Data Access & Data Integration Technology Providers > > > > > > > -Original Message- > > > > From: George Nicolae [mailto:[EMAIL PROTECTED]] > > > > Sent: Monday, December 31, 2001 12:51 PM > > > > To: [EMAIL PROTECTED] > > > > Subject: Re: [PHP-DB] odbc date > > > > > > > > > > > > i did it with date("F j, Y",strtotime(odbc_result($cur,"date"))). > > > > but i very curios about the query. it must looke like..? > > > > select date from my_table? > > > > > > > > -- > > > > > > > > > > > > Best regards, > > > > George Nicolae > > > > IT Manager > > > > ___ > > > > X-Playin - Professional Web Design > > > > www.x-playin.f2s.com > > > > > > > > > > > > > > > > > > > > > Or you can format it with odbc date syntax in your query { d > > > > '-MM-DD' } > > > > > > > > > > > > > > > > -- > > > > PHP Database Mailing List (http://www.php.net/) > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > To contact the list administrators, e-mail: > > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] odbc date
George, Yes, using the date() example. Cheers, Andrew > -Original Message- > From: George Nicolae [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 31, 2001 1:26 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] odbc date > > > it is right but I want to select all data from a mdbdatabase table and I > receive in '/mm/dd hh:mm:ss' format. > I told you I resolve this problem with date("F j, > Y",strtotime(odbc_result($cur,"date"))). > I what to know if I can receive a specific format from query "select date > from my_table" > > -- > > > Best regards, > George Nicolae > IT Manager > ___ > X-Playin - Professional Web Design > www.x-playin.f2s.com > > > > "Andrew Hill" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > George, > > > > The ODBC date syntax is best used for to make input format unambiguous, > > e.g.: > > > > select * from orders where order_date = { d '2002-01-01'} > > This will allow you to select from a table regardless of the > date format. > > > > For converting a date from one format to another, select it from a table > and > > then use the PHP date() function to convert, e.g.: > > > > while (list ($timestamp) = each ($result_array)) > > { > > $new_format = date(Y-m-d, $timestamp); > > echo "$new_format"; > > } > > > > Best regards, > > Andrew Hill > > Director of Technology Evangelism > > OpenLink Software http://www.openlinksw.com > > Universal Data Access & Data Integration Technology Providers > > > > > -Original Message- > > > From: George Nicolae [mailto:[EMAIL PROTECTED]] > > > Sent: Monday, December 31, 2001 12:51 PM > > > To: [EMAIL PROTECTED] > > > Subject: Re: [PHP-DB] odbc date > > > > > > > > > i did it with date("F j, Y",strtotime(odbc_result($cur,"date"))). > > > but i very curios about the query. it must looke like..? > > > select date from my_table? > > > > > > -- > > > > > > > > > Best regards, > > > George Nicolae > > > IT Manager > > > ___ > > > X-Playin - Professional Web Design > > > www.x-playin.f2s.com > > > > > > > > > > > > > > > > Or you can format it with odbc date syntax in your query { d > > > '-MM-DD' } > > > > > > > > > > > > -- > > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > > > > > > > > > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] odbc date
it is right but I want to select all data from a mdbdatabase table and I receive in '/mm/dd hh:mm:ss' format. I told you I resolve this problem with date("F j, Y",strtotime(odbc_result($cur,"date"))). I what to know if I can receive a specific format from query "select date from my_table" -- Best regards, George Nicolae IT Manager ___ X-Playin - Professional Web Design www.x-playin.f2s.com "Andrew Hill" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > George, > > The ODBC date syntax is best used for to make input format unambiguous, > e.g.: > > select * from orders where order_date = { d '2002-01-01'} > This will allow you to select from a table regardless of the date format. > > For converting a date from one format to another, select it from a table and > then use the PHP date() function to convert, e.g.: > > while (list ($timestamp) = each ($result_array)) > { > $new_format = date(Y-m-d, $timestamp); > echo "$new_format"; > } > > Best regards, > Andrew Hill > Director of Technology Evangelism > OpenLink Software http://www.openlinksw.com > Universal Data Access & Data Integration Technology Providers > > > -----Original Message- > > From: George Nicolae [mailto:[EMAIL PROTECTED]] > > Sent: Monday, December 31, 2001 12:51 PM > > To: [EMAIL PROTECTED] > > Subject: Re: [PHP-DB] odbc date > > > > > > i did it with date("F j, Y",strtotime(odbc_result($cur,"date"))). > > but i very curios about the query. it must looke like..? > > select date from my_table? > > > > -- > > > > > > Best regards, > > George Nicolae > > IT Manager > > ___ > > X-Playin - Professional Web Design > > www.x-playin.f2s.com > > > > > > > > > > > Or you can format it with odbc date syntax in your query { d > > '-MM-DD' } > > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] odbc date
George, The ODBC date syntax is best used for to make input format unambiguous, e.g.: select * from orders where order_date = { d '2002-01-01'} This will allow you to select from a table regardless of the date format. For converting a date from one format to another, select it from a table and then use the PHP date() function to convert, e.g.: while (list ($timestamp) = each ($result_array)) { $new_format = date(Y-m-d, $timestamp); echo "$new_format"; } Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: George Nicolae [mailto:[EMAIL PROTECTED]] > Sent: Monday, December 31, 2001 12:51 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] odbc date > > > i did it with date("F j, Y",strtotime(odbc_result($cur,"date"))). > but i very curios about the query. it must looke like..? > select date from my_table? > > -- > > > Best regards, > George Nicolae > IT Manager > ___ > X-Playin - Professional Web Design > www.x-playin.f2s.com > > > > > > Or you can format it with odbc date syntax in your query { d > '-MM-DD' } > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] odbc date
i did it with date("F j, Y",strtotime(odbc_result($cur,"date"))). but i very curios about the query. it must looke like..? select date from my_table? -- Best regards, George Nicolae IT Manager ___ X-Playin - Professional Web Design www.x-playin.f2s.com > Or you can format it with odbc date syntax in your query { d '-MM-DD' } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] odbc date
George, You can use the date() function in PHP to change the format: http://www.php.net/manual/en/function.date.php Or you can format it with odbc date syntax in your query { d '-MM-DD' } Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: George Nicolae [mailto:[EMAIL PROTECTED]] > Sent: Sunday, December 30, 2001 5:37 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] odbc date > > > for Win32(NT) and MSAcess 2000, whenever you retrieve a date column/field, > php will automatically convert it to '/mm/dd hh:mm:ss' format > regardless > of the style of date you've denoted in Access > > how can I resolve this problem and print in a different format? > -- > > > Best regards, > George Nicolae > IT Manager > ___ > X-Playin - Professional Web Design > www.x-playin.f2s.com > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] odbc date
If everything else fails, you can retrieve unix_timestamp(date) and use PHP's date() to format the output. HTH Bogdan George Nicolae wrote: > for Win32(NT) and MSAcess 2000, whenever you retrieve a date column/field, > php will automatically convert it to '/mm/dd hh:mm:ss' format regardless > of the style of date you've denoted in Access > > how can I resolve this problem and print in a different format? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] ODBC MS SQL Server 7
Javalina, What is the exact error message your are getting? Also, try the "odbctest" sample program with the "select * from frases" query - does it return results? Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: Javalina [mailto:[EMAIL PROTECTED]] > Sent: Friday, December 21, 2001 7:51 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] ODBC MS SQL Server 7 > > > Hi to all...please can you help me ...because i cant retrieve any row > of the database on MS SQL Server 7 with ODBC . i did use Openlink > driver on a Solaris 6 machine (Sparc) , the database are on WIN NT4.0 > > my code is. > > /* some environment variables, you can test to comment them out to see > if things > * still work. > */ > putenv("LD_LIBRARY_PATH=/base/odbc/lib:$LD_LIBRARY_PATH"); > putenv("UDBCINI=/base/odbc/bin/udbc.ini"); > putenv("ODBCINI=/base/odbc/bin/odbc.ini"); > putenv("DebugFile=/tmp/udbc.out");// debug trace output > > $dsn="NT";// note 'DSN=' is required > $user="shark"; > $password="shark"; > > $sql="select * from frases "; > > $connect_odbc=odbc_connect($dsn,"shark","shark",SQL_CUR_USE_ODBC) or > die("Erreur > de connexion au serveur"); > if (!odbc_autocommit($connect_odbc, TRUE)) { > echo 'pb auto_commit'; > return; > } > // selection avant > $Req_hebd = "select * from frases "; > echo $Req_hebd .''; > > if (!($Res_hebd=odbc_prepare($connect_odbc,$Req_hebd))) { > echo 'pb prepare'; > } > if (!odbc_execute($Res_hebd)) { > echo 'pb execute'; > } > if (!($res=odbc_result_all($Res_hebd))) { > echo 'pb result_all'; > } > > ?> > this code reply "NO ROWS FOUND" , the connection are OK...the databse > have many rows(of course).. > > Thank's a lot. > > Cristian > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] ODBC with MS Access DB
Charles, The specific error message would be helpful. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: Charles F. McKnight [mailto:[EMAIL PROTECTED]] > Sent: Thursday, December 13, 2001 4:21 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] ODBC with MS Access DB > > > I am writing a simple application that will store data in an > Access database. > I have gotten a simple script that connects and selects some data from the > database and this works fine. when I try to insert or update data > it fails. I > assume I am missing some permissions or something to make it be > readonly when I connect but the following is the relevant code in case it > lies there: > > $db=odbc_connect('test', 'test', 'test') > $query="INSERT INTO test (firstname) VALUES('Charles')"; > $result=odbc_exec( $db, $query); > > As you can see it is about as simple as I can make it for a test so if > someone could point me in the right direction to get this up and running I > would greatly appreciate it. > > Thanks in advance, > Charles > > -- > Charles F. McKnight IRC: sokudo | Doubt is not a pleasant > condition, but > [EMAIL PROTECTED] ICQ: 2794793 | certainty is absurd. > [EMAIL PROTECTED] PGP: 0x20A5BCE5 | > - Voltaire > [ http://chucksays.mywebsitesucks.com > ]- > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] ODBC .. ehm .. help :)
If you followed the howto and you are still receiving an "undefined function" error, than you might have more than one apache/php instance, and you are starting the wrong one :) What was the configure command you used? Did you use a --prefix? If so, that is the one you need to start. Also, check the output of your phpinfo(); to verify ODBC is enabled - the link you gave to info.php is 'forbidden'. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: b i k k e l [mailto:[EMAIL PROTECTED]] > Sent: Thursday, December 13, 2001 11:24 AM > To: [EMAIL PROTECTED] > Subject: RE: [PHP-DB] ODBC .. ehm .. help :) > > > Yes, i follows all the steps described at www.iodbc.org. Still no > result :( > > -- > Original Message > From: "Andrew Hill"<[EMAIL PROTECTED]> > Subject: RE: [PHP-DB] ODBC .. ehm .. help :) > Date: Thu, 13 Dec 2001 09:32:25 -0500 > > >Bikkel, > > > >Is ODBC enabled on your sever? > >If this is a *nix server, follow the Howto at www.iodbc.org. If windows, > >check your odbc.ini for the proper setting. > > > >Best regards, > >Andrew Hill > >Director of Technology Evangelism > >OpenLink Software http://www.openlinksw.com > >Universal Data Access & Data Integration Technology Providers > > > >> -Original Message- > >> From: b i k k e l [mailto:[EMAIL PROTECTED]] > >> Sent: Thursday, December 13, 2001 4:35 AM > >> To: [EMAIL PROTECTED] > >> Subject: [PHP-DB] ODBC .. ehm .. help :) > >> > >> > >> Hi, > >> > >> i get the following error with the code listed below: "Fatal > >> error: Call to > >> undefined function: odbc_connect() in > >> /home/users/sites/www.nlhq.nl/html/connect.php3 on line 2" > >> > >> >> $db = odbc_connect('server4.1a.nl', '', '', SQL_CUR_USE_ODBC); > >> ?> > >> > >> This is the URL of the PHP script: http://www.nlhq.nl/connect.php3 > >> > >> Tought it might my usefull to give ya all the info i can get .. so .. > >> http://www.nlhq.nl/info.php > >> > >> Hope some1 can help me out here .. > >> Thanx! > >> > >> > >> > >> -- > >> PHP Database Mailing List (http://www.php.net/) > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> To contact the list administrators, e-mail: > [EMAIL PROTECTED] > >> > >> > >> > > > > > > > > _ > Free email with personality! Over 200 domains! > http://www.MyOwnEmail.com > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] ODBC .. ehm .. help :)
Bikkel, Is ODBC enabled on your sever? If this is a *nix server, follow the Howto at www.iodbc.org. If windows, check your odbc.ini for the proper setting. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: b i k k e l [mailto:[EMAIL PROTECTED]] > Sent: Thursday, December 13, 2001 4:35 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] ODBC .. ehm .. help :) > > > Hi, > > i get the following error with the code listed below: "Fatal > error: Call to > undefined function: odbc_connect() in > /home/users/sites/www.nlhq.nl/html/connect.php3 on line 2" > >$db = odbc_connect('server4.1a.nl', '', '', SQL_CUR_USE_ODBC); > ?> > > This is the URL of the PHP script: http://www.nlhq.nl/connect.php3 > > Tought it might my usefull to give ya all the info i can get .. so .. > http://www.nlhq.nl/info.php > > Hope some1 can help me out here .. > Thanx! > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] ODBC problem
Hello, We resolved ourselves the problem by changing the ODBC driver. Bye. - Original Message - From: "Christine Cameli" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Cc: "Katell Galard" <[EMAIL PROTECTED]> Sent: Tuesday, December 11, 2001 5:03 PM Subject: [PHP-DB] ODBC problem Hello, I'm accessing DBASE files (*.dbf) through the ODBC API of a PHP 4.6.0 module. I can select information, I can insert information but I can not delete neither update. Here is my code and the associated error messages : $connect_odbc=odbc_connect($Host,"","",SQL_CUR_USE_ODBC) or die("Erreur de connexion au serveur"); if (!odbc_autocommit($connect_odbc, TRUE)) { echo 'pb auto_commit'; return; } // selection avant $Req_hebd = "select * from fichhebd where NOSAL=$Nosal and NOSEM=$Nosem and ANNEE=".substr($Annee,2,2); echo $Req_hebd .''; if (!($Res_hebd=odbc_prepare($connect_odbc,$Req_hebd))) { echo 'pb prepare'; } if (!odbc_execute($Res_hebd)) { echo 'pb execute'; } if (!($res=odbc_result_all($Res_hebd))) { echo 'pb result_all'; } - all is OK : the following lines appear : NOSAL NOSEM ANNEE IDRUBRIQUE IDCONTRAT NBMINUTE 22.0 43.0 1.0 RD 593 1230.0 22.0 43.0 1.0 RD 593 2.0 echo "res:" . $res; odbc_free_result($Res_hebd); // essai sur update $Req_hebd="UPDATE fichhebd set NBMINUTE=0 WHERE NOSAL=$Nosal and NOSEM=$Nosem and ANNEE=".substr($Annee,2,2); echo $Req_hebd .''; $Res_hebd = odbc_exec($connect_odbc,$Req_hebd); PB : the following lines appear : Warning: SQL error: [Microsoft][Pilote ODBC dBase] L'opération doit utiliser une requête qui peut être mise à jour., SQL state S1000 in SQLExecDirect in C:\Inetpub\wwwroot\CRA\Normal\valider.php on line 140 NB : 'L'opération doit utiliser une requête qui peut être mise à jour' means 'it is not possible to make au update request'. echo 'num_row:' . odbc_num_rows($Res_hebd) .''; odbc_free_result($Res_hebd); $Req_hebd="DELETE FROM fichhebd WHERE NOSAL=$Nosal and NOSEM=$Nosem and ANNEE=".substr($Annee,2,2); echo $Req_hebd .''; $Res_hebd = odbc_exec($connect_odbc,$Req_hebd); PB : the following lines appear : Warning: SQL error: [Microsoft][Pilote ODBC dBase] Impossible de supprimer dans les tables spécifiées., SQL state S1000 in SQLExecDirect in C:\Inetpub\wwwroot\CRA\Normal\valider.php on line 146 NB : ' Impossible de supprimer dans les tables spécifiées' means 'It is not possible to suppress in the specified tables'. echo 'num_row:' . odbc_num_rows($Res_hebd) .''; odbc_free_result($Res_hebd); // end of the php script Thank you for helping me. Best regards. --- Christine CAMELI ELIOS Informatique Tél : 02 96 48 51 51 -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] ODBC
Alfarees, To get the first 5 in the order they were added to the database ... select * from tablename limit 5; or, for the 5 topmost, highest value select * from tablename where somefield.value > somecriteria order by tablename.somefield limit 5 Now check docs for exact synatx - TOP may be used in place of LIMIT HTH - Miles Thompson PS If you are not familiar with SQL, there are a number of tutorials on the web which will be well worth a couple of hours of your time. The DevShed and WebMonkey sites come to mind. /mt At 07:33 AM 11/18/01 +, alfareees alfareees wrote: >how can I take the first 5 records from access xp >by odbc or PHP ? > >_ >Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp > > >-- >PHP Database Mailing List (http://www.php.net/) >To unsubscribe, e-mail: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] >To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] ODBC connection under Win32 + Apache + SQL Server
Victor, Your DSN is not being passed correctly. Under unix this could be an envrionment variable issue, but I suspect that you just have a reference error. Try something like: $dsn="MQIS"; $pwd="sa"; $conn=odbc_connect("$dsn","$pwd",""); if that doesn't work, try $dsn="dsn=MQIS"; Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: Victor Espina [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 11, 2001 11:55 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] ODBC connection under Win32 + Apache + SQL Server > > > Hi, i'm new using PHP i'm trying to run some basic PHP scripts to > retrieve a > show data coming from a SQL Server database. The problem is that > when i try > to run this: > > $conn=odbc_connect("MQIS","sa",""); > > PHP returns the following warning: > > Warning: SQL error: [Microsoft][ODBC Driver Manager] Data source name not > found and no default driver specified > > I test the DSN with VFP using: > > SQLStringConnect("dsn=MQIS;usr=sa;pwd=;") > > and it works pretty fine. ¿What could be the problem here? > > TIA > > Victor > > -- > == > Victor Espina > Caracas, Venezuela > http://mitrompo.com/vespina > [EMAIL PROTECTED] > (Quite el 'nospam' para responder) > (Remove 'nospam' to reply) > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] ODBC connection problem
Don, Your DSN may be set to "exclusive" connection mode (check under options). Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: Don Jackson [mailto:[EMAIL PROTECTED]] > Sent: Monday, September 10, 2001 8:09 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] ODBC connection problem > > > Windows NT 4.0 workstation > Apache > PHP 4 > > I'm using ODBC to connect to dbase tables. > the following code works fine and returns the correct results... > > $connect = odbc_connect("partner","",""); > > $query = "SELECT company FROM listing"; > > $result = odbc_exec($connect, $query); > > while(odbc_fetch_row($result)){ > print odbc_result($result, "company") . ""; > } > > odbc_close($connect); > ?> > --- > > but if someone else is accessing the table (not exclusively) i > get the error > message. > -- > Warning: SQL error: [Microsoft][ODBC dBase Driver] The Microsoft Jet > database engine cannot open the file 'N:\listing.DBF'. It is > already opened > exclusively by another user, or you need permission to view its data., SQL > state S1000 in SQLExecDirect in c:\Program Files\Apache > Group\Apache\htdocs/test.php on line 6 > -- > > Is there a work around for this or a fix? > I need to give internet access for this older internal database > at the same > time local users are accessing it. > > thanks in advance > > don > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] ODBC and SQL Server
Andrew - Since I installed the OpenLink ODBC, the MS SQL Server Enterprise Manager has just about become useless as well as MS SQL Server itself. It take many minutes to do just about anything - even after I uninstalled OL. Do you have any suggestions? Todd -- Todd Cary Ariste Software [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] ODBC and SQL Server
Todd, Download and install the Lite (Single Tier) driver from our site (Product Availability link) to your Win box. Configure and test a DSN in the ODBC Administrator (The Test button shows up in the Create New Datasource dialog - be sure to hit "Apply" before the Test button, or it will not find the DSN you created :). Try the same PHP code. The trial Lite will expire in 30 days. Multi-Tier is more powerful, faster, and has a free 2-user connection, but for purposes of testing Lite will be easier to configure for proof-of-concept. Free support is available for any of our products at http://www.openlinksw.com/support/suppindx.htm. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: Todd Cary [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 05, 2001 6:16 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] ODBC and SQL Server > > > Andrew - > > What I am trying to do is to find out if I can use PHP with my client's > MS SQL Server DB. Anything that can help me obtain that information > would be greatly appreciated. > > OS: Win 2K (SP 2) > DBMS: MS SQl Server 7 > > Todd > -- > Todd Cary > Ariste Software > [EMAIL PROTECTED] > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] ODBC and SQL Server
Andrew - What I am trying to do is to find out if I can use PHP with my client's MS SQL Server DB. Anything that can help me obtain that information would be greatly appreciated. OS: Win 2K (SP 2) DBMS: MS SQl Server 7 Todd -- Todd Cary Ariste Software [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] ODBC and SQL Server
Todd, I don't believe so. Try passing in user and pass variables into your odbc_connect - I'm not sure that is happening. I've about reached my usefulness with regards to debugging a driver connection in someone else's ODBC drivers. At the risk of a plug, I can certainly get our working :) much better logging, etc if you have a problem. If you want to try ours it should be fairly straightfoward :) You can use either Lite or MT. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: Todd Cary [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 05, 2001 5:42 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] ODBC and SQL Server > > > Andrew - > > Could it be that the string, "Acct32_ODBC\ 0", should be "Acct32_ODBC"? > If so, how do I get rid of the terminating "\0" in PHP? > > Todd > > -- > Todd Cary > Ariste Software > [EMAIL PROTECTED] > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] ODBC and SQL Server
Andrew - Could it be that the string, "Acct32_ODBC\ 0", should be "Acct32_ODBC"? If so, how do I get rid of the terminating "\0" in PHP? Todd -- Todd Cary Ariste Software [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] ODBC and SQL Server
Andrew - Thank you for getting back to me... <<< Well, does the "Test" button on your ODBC Admininstrator shed any light? :) If it works there, and doesn't work in your PHP, create an ODBC Trace in the Administrator so you can see the exact parameters of the connect. >>> The test does give me an OK. Here are the results of a trace. First, I tried the odbc_connect; then I did the Test. Unfortunately, most of my C/S experience is with Interbase, so I am not sure what the trace is telling me. Are you able to get a hint as to what I am not doing correctly? Todd inetinfo49c-7fc ENTER SQLAllocEnv HENV * 00ADCD90 inetinfo49c-7fc EXIT SQLAllocEnv with return code 0 (SQL_SUCCESS) HENV * 0x00ADCD90 ( 0x01812708) inetinfo49c-7fc ENTER SQLAllocConnect HENV01812708 HDBC * 00ADCD94 inetinfo49c-7fc EXIT SQLAllocConnect with return code 0 (SQL_SUCCESS) HENV01812708 HDBC * 0x00ADCD94 ( 0x01811688) inetinfo49c-7fc ENTER SQLConnectW HDBC01811688 WCHAR * 0x018121E8 [ -3] "Acct32_ODBC\ 0" SWORD -3 WCHAR * 0x1F7F8B88 [ -3] "**\ 0" SWORD -3 WCHAR * 0x1F7F8B88 [ -3] "**\ 0" SWORD -3 inetinfo49c-7fc EXIT SQLConnectW with return code -1 (SQL_ERROR) HDBC01811688 WCHAR * 0x018121E8 [ -3] "Acct32_ODBC\ 0" SWORD -3 WCHAR * 0x1F7F8B88 [ -3] "**\ 0" SWORD -3 WCHAR * 0x1F7F8B88 [ -3] "**\ 0" SWORD -3 DIAG [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'PENTIUM3\IUSR_PENTIUM3'. (18456) DIAG [28000] [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'PENTIUM3\IUSR_PENTIUM3'. (18456) inetinfo49c-7fc ENTER SQLErrorW HENV01812708 HDBC01811688 HSTMT WCHAR * 0x0226E798 (NYI) SDWORD *0x0226E7E0 WCHAR * 0x0226E398 SWORD 511 SWORD * 0x0226E7DE inetinfo49c-7fc EXIT SQLErrorW with return code 0 (SQL_SUCCESS) HENV01812708 HDBC01811688 HSTMT WCHAR * 0x0226E798 (NYI) SDWORD *0x0226E7E0 (18456) WCHAR * 0x0226E398 [ 94] "[Microsoft][ODBC SQL Server Driver][SQL Server]" SWORD 511 SWORD * 0x0226E7DE (94) inetinfo49c-7fc ENTER SQLFreeConnect HDBC01811688 inetinfo49c-7fc EXIT SQLFreeConnect with return code 0 (SQL_SUCCESS) HDBC01811688 -- Todd Cary Ariste Software [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] ODBC and SQL Server
Well, does the "Test" button on your ODBC Admininstrator shed any light? :) If it works there, and doesn't work in your PHP, create an ODBC Trace in the Administrator so you can see the exact parameters of the connect. HTH Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: Todd Cary [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, September 05, 2001 2:49 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] ODBC and SQL Server > > > I am trying to setup an ODBC connect to SQL Server. My DSN is > "Acct32_ODBC". I am using NT Authentication, so that could be my > problem. > > odbc_connect("Acct32_ODBC", "", ""); > > Warning: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Login > failed for user > 'PENTIUM3\IUSR_PENTIUM3'., SQL state 28000 in SQLConnect in > C:\Webroot\testodbc.php on line 33 > > Any suggestions on how I can resolve this? > > Many thanks. > > Todd > -- > Todd Cary > Ariste Software > [EMAIL PROTECTED] > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] ODBC Drivers that doesn't support odbc_fetch_row
Erich, ODBCScan is a tool that can interrogate ODBC drivers to discover properties they support. It's available to download from www.openlinksw.com Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: Erich Reimberg N. [mailto:[EMAIL PROTECTED]] > Sent: Friday, August 31, 2001 1:30 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] ODBC Drivers that doesn't support odbc_fetch_row > > > Hello, > > I'm building an application that uses odbc_fetch_row with a row > number (odbc_fetch_row($cx, 0)). > > This works fine in MS-SQL7.0, but the PHP manual explains that > using odbc_fetch_row with a row number (second argument) might not > work with some drivers. > > Does anyone of you have an experience with this? I would like to know > which drivers don't support a row number with odbc_fetch_row, because > I might probably have to use this application with different DBs. > > Thanks in advance, > > Erich Reimberg N > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] ODBC Woes
Jonathan, Passing different configs should be as simple as passing different $dsn values in, and configure the info in your odbc.ini file. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 28, 2001 4:15 PM > To: [EMAIL PROTECTED] > Subject: Re: [PHP-DB] ODBC Woes > > > I am attempting to use oPAYc (www.opayc.com) as a central method > of payment > processing. In order to pass information like different store configs or > certificates at runtime, I need to pass them in the DSN string area. I'm > using iODBC right now. > > - Jonathan > > "Andrew Hill" <[EMAIL PROTECTED]> wrote in message > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > > Nope, it depends on the driver manager you are using, and I believe the > > first example has been deprecated in nearly all cases. Why do > you need to > > use the first? > > > > Just use variables: > > > > $dsn="dsnname"; > > $uid="user"; > > $pwd="password"; > > > > odbc_conenct($dsn, $uid, $pwd) > > > > Best regards, > > Andrew Hill > > Director of Technology Evangelism > > OpenLink Software http://www.openlinksw.com > > Universal Data Access & Data Integration Technology Providers > > > > > -Original Message- > > > From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]] > > > Sent: Tuesday, August 28, 2001 4:05 PM > > > To: [EMAIL PROTECTED] > > > Subject: [PHP-DB] ODBC Woes > > > > > > > > > Okay, all I need to know is this: > > > Some people say that they can only connect with: > > > odbc_connect("DSN=Datasource;UID=username;PWD=password","",""); > > > > > > Others say that doesn't work, and that they can only connect with: > > > odbc_connect("Datasource","username","password"); > > > > > > I am confused. I can use the second example (I'm on PHP 4.0.3), > > > but not hte > > > first, although I need to use the first example. Is there some sort of > > > switch that lets you decide what format you can follow? > > > > > > - Jonathan > > > > > > > > > > > > -- > > > PHP Database Mailing List (http://www.php.net/) > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > To contact the list administrators, e-mail: > [EMAIL PROTECTED] > > > > > > > > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] ODBC Woes
if($TFM_Doesnt_Have_Anything_About_It == 1) { $Shut_Yer_Unhelpful_Trap = 1; $You->RTFM && see(); } "Yves Glodt" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... if ($RTFM == 1) { int odbc_connect (string dsn, string user, string password [, int cursor_type]) } else { $do_this='http://php.net/download-docs.php'; } On Tuesday 28 August 2001 22:05, Jonathan Hilgeman wrote: > Okay, all I need to know is this: > Some people say that they can only connect with: > odbc_connect("DSN=Datasource;UID=username;PWD=password","",""); > > Others say that doesn't work, and that they can only connect with: > odbc_connect("Datasource","username","password"); > > I am confused. I can use the second example (I'm on PHP 4.0.3), but > not hte first, although I need to use the first example. Is there > some sort of switch that lets you decide what format you can follow? > > - Jonathan -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] ODBC Woes
On Tuesday 28 August 2001 22:05, Jonathan Hilgeman wrote: > Okay, all I need to know is this: > Some people say that they can only connect with: > odbc_connect("DSN=Datasource;UID=username;PWD=password","",""); > > Others say that doesn't work, and that they can only connect with: > odbc_connect("Datasource","username","password"); > > I am confused. I can use the second example (I'm on PHP 4.0.3), but > not hte first, although I need to use the first example. Is there > some sort of switch that lets you decide what format you can follow? > > - Jonathan if ($RTFM == 1) { int odbc_connect (string dsn, string user, string password [, int cursor_type]) } else { $do_this='http://php.net/download-docs.php'; } -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] ODBC Woes
I am attempting to use oPAYc (www.opayc.com) as a central method of payment processing. In order to pass information like different store configs or certificates at runtime, I need to pass them in the DSN string area. I'm using iODBC right now. - Jonathan "Andrew Hill" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Nope, it depends on the driver manager you are using, and I believe the > first example has been deprecated in nearly all cases. Why do you need to > use the first? > > Just use variables: > > $dsn="dsnname"; > $uid="user"; > $pwd="password"; > > odbc_conenct($dsn, $uid, $pwd) > > Best regards, > Andrew Hill > Director of Technology Evangelism > OpenLink Software http://www.openlinksw.com > Universal Data Access & Data Integration Technology Providers > > > -Original Message- > > From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]] > > Sent: Tuesday, August 28, 2001 4:05 PM > > To: [EMAIL PROTECTED] > > Subject: [PHP-DB] ODBC Woes > > > > > > Okay, all I need to know is this: > > Some people say that they can only connect with: > > odbc_connect("DSN=Datasource;UID=username;PWD=password","",""); > > > > Others say that doesn't work, and that they can only connect with: > > odbc_connect("Datasource","username","password"); > > > > I am confused. I can use the second example (I'm on PHP 4.0.3), > > but not hte > > first, although I need to use the first example. Is there some sort of > > switch that lets you decide what format you can follow? > > > > - Jonathan > > > > > > > > -- > > PHP Database Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] ODBC Woes
Nope, it depends on the driver manager you are using, and I believe the first example has been deprecated in nearly all cases. Why do you need to use the first? Just use variables: $dsn="dsnname"; $uid="user"; $pwd="password"; odbc_conenct($dsn, $uid, $pwd) Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: Jonathan Hilgeman [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, August 28, 2001 4:05 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] ODBC Woes > > > Okay, all I need to know is this: > Some people say that they can only connect with: > odbc_connect("DSN=Datasource;UID=username;PWD=password","",""); > > Others say that doesn't work, and that they can only connect with: > odbc_connect("Datasource","username","password"); > > I am confused. I can use the second example (I'm on PHP 4.0.3), > but not hte > first, although I need to use the first example. Is there some sort of > switch that lets you decide what format you can follow? > > - Jonathan > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] ODBC and PHP
Ariadne, This appears to be an error in the driver itself, but without a trace I cannot be sure. Best regards, Andrew > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, August 01, 2001 10:52 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: [PHP-DB] ODBC and PHP > > > > The error message is: > > - > Cadastro de Fornecedor > > > Warning: SQL error: [Microsoft][ODBC SQL Server Driver][Named > Pipes]ConnectionTransact > (TransactNamedPipe())., SQL state 01000 in SQLExecDirect in > c:\inetpub\inventario\cadastro\fornecedor.php > on line 364 > > Warning: Supplied argument is not a valid ODBC result resource in > c:\inetpub\inventario\cadastro\fornecedor.php > on line 366 > > Warning: SQL error: [Microsoft][ODBC SQL Server Driver]Communication link > failure, SQL state 08S01 in SQLExecDirect in > c:\inetpub\inventario\cadastro\fornecedor.php > on line 386 > > - > > But the trace works fine. To make it work again I have to remove > the configuration > from the ODBC and create again. > > []s > > Ariadne > > > > Mensagem original > > >Ariadne, > > > >What is the exact error you get? > >Among other debugging tricks, you can get an ODBC trace from the ODBC > >Administrator control panel (if using Win32 on client side) and look at > >where the API calls are failing. > > > >Best regards, > >Andrew Hill > >Director of Technology Evangelism > >OpenLink Software http://www.openlinksw.com > >Universal Data Access & Data Integration Technology Providers > > > >> -Original Message- > >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > >> Sent: Friday, July 27, 2001 6:30 PM > >> To: [EMAIL PROTECTED] > >> Subject: [PHP-DB] ODBC and PHP > >> > >> > >> > >> I´m using PHP 4 with ODBC and sometimes I get a response that > was unable > >> to connect to the MSSQL database. Then I go to the ODBC configuration > >to > >> test the connection and I get a response that everything is > working fine, > >> but my pages still can´t connect. Is that normal? What can I do? > >> > >> I´m using NT Server 4 with apache 1.3. > >> > >> []s > >> > >> Ariadne > >> > >> > >> > >> > >> -- > >> PHP Database Mailing List (http://www.php.net/) > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> To contact the list administrators, e-mail: > [EMAIL PROTECTED] > >> > >> > > > > > > > > > > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] ODBC and PHP
The error message is: - Cadastro de Fornecedor Warning: SQL error: [Microsoft][ODBC SQL Server Driver][Named Pipes]ConnectionTransact (TransactNamedPipe())., SQL state 01000 in SQLExecDirect in c:\inetpub\inventario\cadastro\fornecedor.php on line 364 Warning: Supplied argument is not a valid ODBC result resource in c:\inetpub\inventario\cadastro\fornecedor.php on line 366 Warning: SQL error: [Microsoft][ODBC SQL Server Driver]Communication link failure, SQL state 08S01 in SQLExecDirect in c:\inetpub\inventario\cadastro\fornecedor.php on line 386 - But the trace works fine. To make it work again I have to remove the configuration from the ODBC and create again. []s Ariadne Mensagem original >Ariadne, > >What is the exact error you get? >Among other debugging tricks, you can get an ODBC trace from the ODBC >Administrator control panel (if using Win32 on client side) and look at >where the API calls are failing. > >Best regards, >Andrew Hill >Director of Technology Evangelism >OpenLink Software http://www.openlinksw.com >Universal Data Access & Data Integration Technology Providers > >> -Original Message- >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] >> Sent: Friday, July 27, 2001 6:30 PM >> To: [EMAIL PROTECTED] >> Subject: [PHP-DB] ODBC and PHP >> >> >> >> I´m using PHP 4 with ODBC and sometimes I get a response that was unable >> to connect to the MSSQL database. Then I go to the ODBC configuration >to >> test the connection and I get a response that everything is working fine, >> but my pages still can´t connect. Is that normal? What can I do? >> >> I´m using NT Server 4 with apache 1.3. >> >> []s >> >> Ariadne >> >> >> >> >> -- >> PHP Database Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> To contact the list administrators, e-mail: [EMAIL PROTECTED] >> >> > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] odbc oracle need help!!!!!!
Check the /etc/services if Unix/Linux or c:\windows\services if windows. In the ODBC definition you supply a service name wich must to exist in this file. I hope this helps. -Original Message- From: sdk [mailto:[EMAIL PROTECTED]] Sent: Monday, July 30, 2001 12:29 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] odbc oracle need help!! tried to connect to an oracle db via odbc, but with no success get errormsg that php (php odbc driver) cannot resolve service name can anyone help? -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] ODBC and PHP
Ariadne, What is the exact error you get? Among other debugging tricks, you can get an ODBC trace from the ODBC Administrator control panel (if using Win32 on client side) and look at where the API calls are failing. Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Friday, July 27, 2001 6:30 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] ODBC and PHP > > > > I´m using PHP 4 with ODBC and sometimes I get a response that was unable > to connect to the MSSQL database. Then I go to the ODBC configuration to > test the connection and I get a response that everything is working fine, > but my pages still can´t connect. Is that normal? What can I do? > > I´m using NT Server 4 with apache 1.3. > > []s > > Ariadne > > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] odbc and inner joins...
David, This is most likely related to an issue in the cursor library of PHP that we are working diligently to resolve. To assist, could you please: 1. open a support case at http://www.openlinksw.com/support/suppindx.htm 2. generate an ODBC trace by adding the following lines to your odbc.ini on the linux client: DebugFile=/tmp/openlink.out 3. paste the file into the case or send it to [EMAIL PROTECTED] ATTN:Casenumber Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: David W. Jablonski [mailto:[EMAIL PROTECTED]] > Sent: Thursday, July 05, 2001 12:13 PM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] odbc and inner joins... > > > I'm trying to use odbc_do with a select statement that uses inner joins. > When I type the Select statement directly into the query window for MSSQL > 2000 the query runs fine. > > I use the same select statement through odbc > and I get this error: Warning: SQL error: [OpenLink][ODBC][Driver]Syntax > error or access, SQL state 37000 in SQLExecDirect in > /home/httpd/site.somewhere/htdocs/file.php on line 32. > > This only happens when I add the inner join on my select statement. If I > don't use a inner join through odbc I can get a connection and a > recordset returned so my connection works fine. I add the inner join and > I get the error. The inner join is joining two tables from the same > database so I'm not even crossing databases. > > Here is my select statement: Select Table1.Column1, Table1.Column2 from > Table1 INNER JOIN Table2 ON Table1.ID = Table2.ID; > > If I leave out everything after the INNER JOIN the select statement > works. Any help would be much appreciated. > > PHP 4.0.4/Apache 1.3.14/Openlink ODBC for > glibc2.1/SQL2000 > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] odbc with ms access
http://www.microsoft.com/KB/Articles/Q128/8/08.HTM -Original Message- From: Dalyyla [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 22, 2001 7:32 AM To: [EMAIL PROTECTED] Subject: [PHP-DB] odbc with ms access hi, Access to data with ms access via odbc is kinda slow . I would like to know if it is normal and what can i do to make it faster Thanks Dalyyla -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] odbc errors
P.S. One of the users there mentions that she had to open the odbc_free_result INTO a variable in order for it to work: $free_result = odbc_free_result($sql_result); for example Angie >>> "Jello" <[EMAIL PROTECTED]> 05/15/01 10:27AM >>> i've just upgraded my computer... running win ME ( i know), PWS and PHP 4.0.5 and access 2000 (odbc) ... the same set up as my last one... i keep getting error msg from scripts that worked only last week on the old setup... the DB is ok as it will connect prepare and execute with no error... but then i get the following msg's Warning: Supplied argument is not a valid ODBC result resource in \include\db1.txt on line 18 which is odbc_result_all($sql_result,"border=1"); nothing to fancy there and the same message Warning: Supplied argument is not a valid ODBC result resource in \include\db1.txt on line 21 which is odbc_free_result ($sql_result); again just a basic action... nothing fancy it's strange as all the other bits of the scripts work with no problems so i think its the ODBC set up. but that is where i step out of the light in to a very dark room and it's driving me nuts...any help or pointers would be cool... MTIA Jello a copy of the whole script is below -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] odbc errors
Jello, You may want to look at some of the user comments on odbc_result_all manual on php.net: http://www.php.net/manual/en/function.odbc-result-all.php Some people mentions errors and fixes there for your problem. I think you are getting connected or you would have got your error messages "Couldn't connect" or "Couldn't execute". That error you are getting is a failure to recognize the function and it's parameters, NOT that you aren't connected. Angie >>> "Jello" <[EMAIL PROTECTED]> 05/15/01 10:27AM >>> i've just upgraded my computer... running win ME ( i know), PWS and PHP 4.0.5 and access 2000 (odbc) ... the same set up as my last one... i keep getting error msg from scripts that worked only last week on the old setup... the DB is ok as it will connect prepare and execute with no error... but then i get the following msg's Warning: Supplied argument is not a valid ODBC result resource in \include\db1.txt on line 18 which is odbc_result_all($sql_result,"border=1"); nothing to fancy there and the same message Warning: Supplied argument is not a valid ODBC result resource in \include\db1.txt on line 21 which is odbc_free_result ($sql_result); again just a basic action... nothing fancy it's strange as all the other bits of the scripts work with no problems so i think its the ODBC set up. but that is where i step out of the light in to a very dark room and it's driving me nuts...any help or pointers would be cool... MTIA Jello a copy of the whole script is below -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP-DB] odbc errors
Jello, It appears that your odbc_connect is not happening :) Can you post your code? Best regards, Andrew Hill Director of Technology Evangelism OpenLink Software http://www.openlinksw.com Universal Data Access & Data Integration Technology Providers > -Original Message- > From: Jello [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, May 15, 2001 11:27 AM > To: [EMAIL PROTECTED] > Subject: [PHP-DB] odbc errors > > > i've just upgraded my computer... running win ME ( i know), PWS and PHP > 4.0.5 and access 2000 (odbc) ... the same set up as my last > one... i keep > getting error msg from scripts that worked only last week on the old > setup... > the DB is ok as it will connect prepare and execute with no error... but > then i get the following msg's > > > Warning: Supplied argument is not a valid ODBC result resource in > \include\db1.txt on line 18 > > which is > odbc_result_all($sql_result,"border=1"); > nothing to fancy there > > and the same message > Warning: Supplied argument is not a valid ODBC result resource in > \include\db1.txt on line 21 > > which is > odbc_free_result ($sql_result); > again just a basic action... nothing fancy > > > it's strange as all the other bits of the scripts work with no > problems so i > think its the ODBC set up. but that is where i step out of the > light in to a > very dark room and it's driving me nuts...any help or pointers would be > cool... > > MTIA > Jello > > a copy of the whole script is below > > > > // connect to system dsn odbc name login and password or die > $connect = odbc_connect("db1","login","pword") or die (" not connected"); > > // create SQL statement > $sql = "SELECT id,code,matchcode FROM products "; > > > // prepare SQL statement > $sql_prepare = odbc_prepare($connect,$sql) or die("Couldn't prepare > query."); > > // execute SQL statement and get results > $sql_result = odbc_execute($sql_prepare) or die("Couldn't execute > statement."); > > > // echo the result in a nice table > odbc_result_all($sql_result,"border=1"); > > // free up resources > odbc_free_result ($sql_result); > > // close connection > odbc_close($connect); > > > > ?> > > > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]