php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66 unix uodbc doesnt work with myodbc-2.50.5
Submitted: 1998-02-12 14:56 UTC Modified: 1998-02-13 12:07 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: be at shonline dot de Assigned:
Status: Closed Package: ODBC related
PHP Version: 3.0 Latest CVS OS: solaris 2.5.1
Private report: No CVE-ID: None
 [1998-02-12 14:56 UTC] be at shonline dot de
the setup script tells me:

---
Whether to build PHP with iODBC support. This feature was first
developed for iODBC, but using other ODBC libraries should work as well
with some Makefile tweaking. Enter your iODBC install directory here.
More info about iODBC can be found at http://www.tcx.se/.  If you
answer `yes', the default directory is `/usr/local'.
 
ODBC support? (`yes', `no' or dir) [no] : /opt/mysql

Whether to enabled the unified ODBC support. This is a database module
that compiles with the C API of several DBMSes that happen to use ODBC
as their C-API. Has been tested with iODBC, Solid and Adabas D.
Requires that one (and only one) of these modules is enabled.
 
Enable unified ODBC support? (yes/no) [yes] : yes
---

First of all the setup script does not produce a "configure"
call whith "--enable-unified-odbc" in it.

Second:
myodbc has been tested to work by using odbctool
from the myodbc distribution:

be@shelley:~/mysql/iodbc-2.50.5/SAMPLES $ ./odbctool -q -d mysql "select * from hunz"
<i>select * from hunz</i>
<p>
<table border=1>
<th>bar</th>
<tr>
<td>88</td>
</tr>
<tr>
<td>99</td>
</tr>
</table>

now i run this script as suggested by Andreas Karajannis:

#!./php -q
<?php

   $ln_id=odbc_connect("mysql","","");

   $query="select * from hunz";

   $re_id=odbc_prepare($ln_id,$query);

   $qu_ok=odbc_execute($re_id);

   if ( $qu_ok ) {

     $row=odbc_fetch_row($re_id);

   }
 
?>

It returns:

<br>
<b>Warning</b>:  No tuples available at this result index in <b>./test.php3</b> on line <b>13</b><br>

Then I run this script as suggested by Stig Bakken:

#!./php -q
<?php
 
   $ln_id=odbc_connect("mysql","","");
 
   $query="select * from hunz";
 
   $re_id=odbc_exec($ln_id,$query);
 
   if ( $re_id > 0 ) {
 
     $row=odbc_fetch_row($re_id);
 
   }
 
?>

It returns:

<br>
<b>Warning</b>:  Function SQLExecDirect in <b>./test.php3</b> on line <b>7</b><br>
<br>
<b>Warning</b>:  SQL error: , SQL state 00000 in <b>./test.php3</b> on line <b>7</b><br>

What is wrong here?

Is uodbc really tested to work with myodbc as said in the
setup script?

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1998-02-13 12:07 UTC] ssb
This is a bug in iodbc and/or mysql, the workaround is
using odbc_prepare/odbc_execute instead of odbc_exec.

 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 01:01:28 2024 UTC