ID:               27249
 Updated by:       [EMAIL PROTECTED]
 Reported By:      jlsalinas at gmx dot net
-Status:           Analyzed
+Status:           Closed
 Bug Type:         Documentation problem
 Operating System: Windows Me
 PHP Version:      4.3.4
 New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

"This function will return the list of avaible DNS (after calling it
several times)."

If you want other functionality, create bug in Category "Feature
request".


Previous Comments:
------------------------------------------------------------------------

[2004-07-19 01:31:26] [EMAIL PROTECTED]

The documentation may be out of whack, but your request 
to remove the SQL_FETCH_FIRST and SQL_FETCH_NEXT calls 
is denied.  Unfortunately, the SQL call underneath 
requires these to be passed in.

As for the connection issue, unfortunately due to the 
nature of the ODBC system, an environment variable must 
be passed to the call.  The only place the environment 
variable exists is within a connection.

------------------------------------------------------------------------

[2004-02-14 00:18:35] jlsalinas at gmx dot net

Description:
------------
Even though the documentation states that odbc_data_source "Returns
information about a current connection", it returns the list of avaible
DNS (after calling it several times).

This is a good feature, but maybe in a function called odbc_list_dns
and without the need for an argument with a previously established
connection (maybe ODBC internals require the connection to get them, I
don't know).

What I expected after reading the docs about odbc_data_source was:
 - odbc driver used (xtg for interbase6 in my case)
 - underlying database (firebird 1.5rc8 in my case)
 - perhaps other information, depending on the dbms

My code is:

----- begin --------------------------
<pre>
<?php
  $conn = odbc_connect ($dns_name, $user, $pass);
  if ($ds = @odbc_data_source ($conn, SQL_FETCH_FIRST)) {
    do {
      var_dump ($ds);
    } while ($ds = @odbc_data_source ($conn, SQL_FETCH_NEXT));
  }
?>
</pre>
----- end ----------------------------

The result (I'm from Spain):

----- begin --------------------------
array(2) {
  ["server"]=>
  string(23) "Archivos de texto ASCII"
  ["description"]=>
  string(36) "Microsoft Text Driver (*.txt; *.csv)"
}
array(2) {
  ["server"]=>
  string(18) "MS Access Database"
  ["description"]=>
  string(31) "Microsoft Access Driver (*.mdb)"
}
[...and some more]
----- end ----------------------------

You see? First, if this function is supposed to give information about
the connection and its data source, why do I need to call it many
times? It's not gonna change! Moreover, the information it gives the
first time, with SQL_FETCH_FIRST, does not correspond with the
specified connection.

And, what is the need to specify if it's the first time or not
(SQL_FETCH_FIRST and SQL_FETCH_NEXT constants)? This second argument
makes no sense to me. Even in a odbc_list_dns function, I'd prefer the
function to return all the DNS as an array, and not having to call it
several times, inside a somewhat weird loop.

I think that correct function calls should be:
 - odbc_data_source ($conn)
 - odbc_list_dns ()

Again, I don't know the internals of ODBC. Maybe odbc_list_dns *needs*
a connection to work. Ok. But, please, no different arguments for the
first and the following calls.

Thank you very much. Keep on doing doing such a great job!




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27249&edit=1

Reply via email to