84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
以前用mysql_query的时候,为了实现数据库计数,是使用
mysql_query("update table set field=field+1 where ....");
这种方式,现在整体换成pdo_mysql的话,
("update table set field=? where ....")
然后?处bind field+1肯定是不行了...
怎么写自增效率较高呢?请教下各位,感谢
人生最曼妙的风景,竟是内心的淡定与从容!
Ah, isn’t there a query method?
$pdo = new \PDO($dsn, $user, $password); $pdo->query("update table set field=field+1 where ....");
It’s okay if you don’t need parameter substitution in this place... just write field=field+1
Ah, isn’t there a query method?
It’s okay if you don’t need parameter substitution in this place... just write field=field+1