ID:               48290
 Updated by:       ras...@php.net
 Reported By:      kexianbin at diyism dot com
-Status:           Open
+Status:           Wont fix
 Bug Type:         Feature/Change Request
 Operating System: Irrelevant
 PHP Version:      5.3.2
 New Comment:

Stop re-opening this please.  Escaping needs to be db-specific since
different dbs use different escape chars.  Therefore it cannot be done
generically at the language level.


Previous Comments:
------------------------------------------------------------------------

[2009-11-10 05:17:35] kexianbin at diyism dot com

Rasmus, I insist that the feature request should be reopen, leave it
here until some day somebody may make it realized.

------------------------------------------------------------------------

[2009-11-10 05:10:29] kexianbin at diyism dot com

Rasmus,

Why not have a think about adding addslash function to double-quoted
strings?
That maybe the simplest solution for variables replacement in sql query
string.

With the addslash function in double-quoted strings, we could code like
this:
$rs=$pdo->query("select *
                   from sem_SearchChangeShow
                   where Keyword={#Keyword}
                         and BatchNum={#BatchNum}
                         and OldChannelID={#ApvChannelID_old}
                         and OldCategoryID={#ApvCategoryID_old}
                 ");
$data=$rs->fetch(PDO::FETCH_ASSOC);

But, without it, we have to code like these:
$sql=$pdo->prepare("select *
                   from sem_SearchChangeShow
                   where Keyword=:Keyword
                         and BatchNum=:BatchNum
                         and OldChannelID=:ApvChannelID_old
                         and OldCategoryID=:ApvCategoryID_old
                 ");
$sql->execute(array(':Keyword'=>$Keyword,
                   ':BatchNum'=>$BatchNum,
                   ':ApvChannelID_old'=>$ApvChannelID_old,
                   ':ApvCategoryID_old'=>$ApvCategoryID_old
                  )
            );
$data=$sql->fetch(PDO::FETCH_ASSOC);

Please don't set the feature request to "won't fix".

------------------------------------------------------------------------

[2009-11-10 04:34:59] ras...@php.net

This is not going to happen.

------------------------------------------------------------------------

[2009-11-10 04:23:10] kexianbin at diyism dot com

Update expected version to 5.3.2

------------------------------------------------------------------------

[2009-11-10 04:12:30] kexianbin at diyism dot com

Try to reopen it.

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/48290

-- 
Edit this bug report at http://bugs.php.net/?id=48290&edit=1

Reply via email to