【发布时间】:2011-12-11 13:33:49
【问题描述】:
如何替换所有“?”变量?比如:
$name = 'test' ;
$lname = 'lastTest';
$id = 1 ;
->where ( 'customers.name = ? and customers.lastname = ? and customers.id = ?' , $name , $lname , $id ) ;
输出:
customers.name = 'test' and customers.lastname = 'lastTest' and customers.id = 1
有什么想法吗?
【问题讨论】:
-
你用什么库来做这个?
-
无,这是我的框架。
-
你为什么需要那个?您是在为数据库实现自己的占位符系统还是什么?不能再具体点吗?
-
是的,我正在实现 sql 语句的制造
-
@Basiclife 好吧,如果 PDO 默认进行字符串连接/操作 - 这是否意味着 PDO 中存在 漏洞?
标签: php replace sqlbuilder