DB::Sybase
| From: | Uwe Pries | Date: | Fri, 23 Jan 2004 12:16:08 +0000 |
| Subject: | DB::Sybase | ||
| Groups: | php.pear.general | ||
| Request: | Send a blank email to pear-general+get-10313@lists.php.net to get a copy of this message | ||
hello list,
I have a litte problem using PEAR::DB Sybase module.
i have two scripts, one is using the native php_sybase functions, the other
one uses PEAR::DB::Sybase.
It's just to connect to the SybaseDB ant send a SELECT-Query for testing.
the connect works in both, but the SELECT statement retuns an error:
Incorrect syntax near 'use'. [nativecode=-2]
#PHP_SYBASE------------------8<-----8<-----8<-----------
<?php
$link = sybase_connect("SYBASE", "uwepries", "___PASSWORD___");
sybase_select_db("opixcntl", $link);
$query = "SELECT * FROM V_OBJECT_ACC_LIB WHERE Acc_User = 'uwepries'
ORDER BY Library";
$result = sybase_query($query, $link);
while($row = sybase_fetch_assoc($result))
{
echo "<pre>";
print_r($row);
echo "</pre>";
}
sybase_close($link);
?>
----------------------8<-----8<-----8<-----------
here you can see the output: http://62.159.254.182/php_sybase.php
-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8
<-----8<-----
#PEAR_SYBASE----------------------8<-----8<-----8<-----------
<?php
$dsn = array(
"phptype" => "sybase"
, "hostspec" => "SYBASE"
, "database" => "opixcntl"
, "username" => "uwepries"
, "password" => "___PASSWORD___"
);
require_once("DB.php");
if (DB::isError($db = DB::connect($dsn)))
{
die("<br>" . $db->getMessage() . "<br>Native: " .
$db->getDebugInfo());
}
$db->setFetchMode(DB_FETCHMODE_ASSOC);
$query = "SELECT * FROM V_OBJECT_ACC_LIB WHERE Acc_User = 'uwepries'
ORDER BY Library";
if (DB::isError($result = $db->query($query)))
{
echo "<br>" . $result->getMessage() . "<br>Native: " .
$result->getDebugInfo();
}
while ($row = $result->fetchRow())
{
echo "<pre>";
print_r($row);
echo "</pre>";
}
$result->free();
$db->disconnect();
?>
----------------------8<-----8<-----8<-----------
and the output: http://62.159.254.182/pear_sybase.php
--->>> DB Error: unknown error
Native: Incorrect syntax near 'use'. [nativecode=-2]
the native version works perfect, but i wrote my application using PEAR::DB
and have to use the PEAR::DB::Sybase module
hope you can help me
many thanks
e-voc [Uwe Pries]
e-voc@judas-price.de
http://www.judas-price.de