From: [EMAIL PROTECTED]
Operating system: linux
PHP version: 4.1.1
PHP Bug Type: ODBC related
Bug description: select (name) from ..... doesnt work!
Using the ODBC functions Im having problem with simple lines like:
select max(id) from ident;
select (name) from main;
But lines like this works fine:
select id, path, name from main order by path, name;
When Im trying the same lines using the MySQL functions it works fine.
Here is a script that shows my problem:
$dbh = mysql_connect("localhost", $user, $password);
mysql_select_db("vr", $dbh);
$rh = mysql_query("select max(id) from ident;") or die("SQL error");
$t = mysql_fetch_row($rh);
echo "Using MySQL I get id: ". $t[0];
mysql_close($dbh);
$dbh = odbc_connect($dsn, $user, $password);
$rh = odbc_exec($dbh, "select max(id) from ident;") or die("SQL error");
$t = odbc_fetch_row($rh);
echo "Using ODBC I get id: ". $t[0];
odbc_close($dbh);
What is does is it prints out the value it gets from each query. The
output I get is:
Using MySQL I get id: 68
Using ODBC I get id:
I can get this to work with perl using DBI and DBI-ODBC so I strongly
believes the problem lies in the ODBC implementation in php.
My configure line is like this:
'./configure' '--with-mysql=/usr/local/mysql'
'--with-apxs=/usr/local/apache/bin/apxs' '--with-db2' '--disable-debug'
'--disable-static' '--enable-sockets' '--with-yp' '--with-zlib'
'--with-iodbc=/usr/local/libiodbc-3.0.5'
--
Edit bug report at http://bugs.php.net/?id=15880&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=15880&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=15880&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=15880&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=15880&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=15880&r=support
Expected behavior: http://bugs.php.net/fix.php?id=15880&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=15880&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=15880&r=submittedtwice