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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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: Sun Dec 22 11:01:30 2024 UTC