Bug #17352: DB::execute in DataBase field name have '-'
| From: | tokimeki at pchome dot com dot tw | Date: | Wed, 22 May 2002 07:21:45 +0000 |
| Subject: | Bug #17352: DB::execute in DataBase field name have '-' | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-6314@lists.php.net to get a copy of this message | ||
From: tokimeki@pchome.com.tw
Operating system: Windows XP
PHP version: 4.2.1
PHP Bug Type: PEAR related
Bug description: DB::execute in DataBase field name have '-'
<code>
$DBX=DB::connect($DSN);
$SQL="INSERT INTO League_Base (
?) VALUES ('?')";
$params=array('zh-twName','foo');
$stmt=$DBX->prepare($SQL);
$Result=$DBX->execute($stmt,$params);
if(DB::isError($Result)) $Message='ERROR';
else $Message='OK';
echo $Message;
</code>
it always show 'ERROR'.
When I change DataBase Field Name from zh-twName to Name,
it show 'OK'...
now, I use another way to do it...
<code>
$DBX=DB::connect($DSN);
$SQL="INSERT INTO League_Base (%s) VALUES ('%s')";
$SQL=sprintf($SQL,'zh-twName','foo');
$Result=$DBX->query($SQL);
if(DB::isError($Result)) $Message='ERROR';
else $Message='OK';
echo $Message;
</code>
it's OK...
--
Edit bug report at http://bugs.php.net/?id=17352&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=17352&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=17352&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=17352&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=17352&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=17352&r=support
Expected behavior: http://bugs.php.net/fix.php?id=17352&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=17352&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=17352&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=17352&r=globals