Home » Database » DB » Bug #9869
SQL Command doesn't work
Details
| Submitted | 2007-01-18 15:34 UTC |
|---|---|
| From | ozgurh at infratech dot com dot tr |
| Assigned | aharvey |
| Status | Closed |
| Package | DB |
| PHP Version | 4.4.4 |
| OS | Windows XP Pro. |
| Roadmaps | (Not assigned) |
Comments
[2007-01-18 15:34 UTC] ozgurh at infratech dot com dot tr
Description:
------------
Hello;
I'm using PEAR DB Package. (with mssql 2000) I saw that if I use " INTO " word in WHERE condition I got an error. All get* functions getting error or unexpected result.
Test script:
---------------
require_once 'DB.php';
$dsn = $XPARAMETERS['db_type'] . "://" . $XPARAMETERS['db_username'] . ":" . $XPARAMETERS['db_password'] . "@" . $XPARAMETERS['db_ip'] . "/" . $XPARAMETERS['db_name'];
$db = DB::connect($dsn, false);
$res = $db->getOne("SELECT COUNT(*) AS SAYI FROM RESOLUTIONS WHERE ( RESOLUTIONS.CODE = ' INTO ' )",null,DB_FETCHMODE_ASSOC);
echo $res;
// $res = $db->getAll("SELECT * FROM RESOLUTIONS WHERE RESOLUTIONS.CODE = ' INTO '");
$db->disconnect();
Expected result:
----------------
1
Actual result:
--------------
Fatal error: Call to a member function on a non-object in c:\inetpub\wwwroot\Spectra271\PEAR\DB\common.php on line 1296