ID: 14436
User updated by: [EMAIL PROTECTED]
Reported By: [EMAIL PROTECTED]
Status: Open
Bug Type: ODBC related
Operating System: WinNT
PHP Version: 4.1.0
New Comment:

Bug has been reproduced in PHP 4.1.0, so I've updated the PHP Version number.

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

[2001-12-11 16:37:50] [EMAIL PROTECTED]

When using odbc_fetch_row() with specific queries, the PHP module attempts to write to 
a NULL pointer, which crashes Apache.

A query must do the following to cause the problem:

1) The query must use only one table (i.e., no joins).

2) The table's name must be aliased (e.g., "FROM MyTable MyAlias").

3) The SELECT clause must use the table's alias with at least one column (e.g., 
"SELECT MyAlias.ID").

The following script can be used to reproduce the bug.

<?php
$Connection = odbc_pconnect('db','user','pass');
$Result = odbc_exec($Connection,'SELECT MyAlias.ID FROM MyTable MyAlias');

while (odbc_fetch_row($Result))
{
echo 'Row<BR>';
}
?>

If I expand the query to do a join with another table, it will work fine. It also 
works fine if I remove the table alias from the SELECT clause. However, the queries I 
need to use are dynamically generated and it is much simpler if I can alias the table 
names without worrying about how many tables are being referenced.

I'm using PHP 4.0.6 (binary download from PHP.net) on Windows NT 4.0 Workstation with 
Apache 1.3.22. I'm connecting via ODBC to a remote Oracle 9i database.


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



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


-- 
PHP Development 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]

Reply via email to