php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7105 sybase queries fails with quotes
Submitted: 2000-10-09 19:17 UTC Modified: 2000-10-10 02:38 UTC
From: johanfo at essay dot org Assigned:
Status: Closed Package: Sybase-ct (ctlib) related
PHP Version: 4.0.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: johanfo at essay dot org
New email:
PHP Version: OS:

 

 [2000-10-09 19:17 UTC] johanfo at essay dot org
./configure  --with-apxs --with-sybase-ct=/opt/sybase-11.9.2/ --with-gd

The ct library was fetched from
http://linux.sybase.com/ase/1192download.html    Yet, this is a ASE Open
Client, it compied just fine.

The below query works fine,  no problem
-----------------------------
$sql = 'SELECT fname FROM customer';
echo "Debug: " . $sql ."\n";
$qry = sybase_query($sql, $db);
while($row = sybase_fetch_array($qry)){
while (list ($key, $val) = each ($row)) {
    echo "$key => $val<br>";
}
-----------------------------

BUT,  when I try to quote the column,  like:
-----------------------------
$sql = 'SELECT "fname" FROM customer';
echo "Debug: " . $sql ."\n";
$qry = sybase_query($sql, $db);
while($row = sybase_fetch_array($qry)){
while (list ($key, $val) = each ($row)) {
    echo "$key => $val<br>";
}
-----------------------------
.. things get messy,  then every row in the result set has 'fname' as value !
As a mather of fact,  not even "DBA"."fname"  which is a common syntax, is allowed.

Is this because of the ASE OpenClient  ?  Anybody else being able to quote
fielnames in queries when using ASA 7..0 ?

I also tested the php connection agains an Windows ASA7 clean install, and asademo as db,  but the php queries fails on quotes even there.

php.ini is not modified.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-10 02:38 UTC] joey@php.net
This is not a PHP bug, but an error in your understanding
of SQL.

select "fname" from anytable

Will return "fname" as many times as there are
rows in the table.

Try, instead

'select fname from anytable'
or
"select fname from anytable"

And buy an SQL book.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 13:01:29 2024 UTC