Re: PHP & Sybase ASA 7.0 Queriues

From: Date: Tue, 10 Oct 2000 17:25:39 +0000
Subject: Re: PHP & Sybase ASA 7.0 Queriues
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-3484@lists.php.net to get a copy of this message
"Johan Fredrik Øhman" wrote: > > 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 ? > Johan, I'm not that familiar with ASA, but what you describe is exactly what I would expect on an ASE server. The ways you have it coded would tell ASE to select the literal 'fname' for each row in the customer table. What are you trying to do by quoting the column name? Frank

« previous php.db (#3484) next »