在wamp下的开发环境,查找资料有两种方法。使用query,使用prepare。看的代码是第二种,网上说第二种效率高,并且安全。 总结使用方法:  
$sth = $dbh->prepare('update db set zh_CN= :str where SN=:SN');
$sth->bindParam(':str',$str,PDO::PARAM_STR,12);
$sth->bindParam(':SN',$SN);
$sth->execute();
$sth->lastInsertId();
$sth->closeCursor();
源代码使用bindValue(),lastInsertId()返回id。

上一篇:
下一篇:

相关文章:

Categories: 博客记录

0 Responses so far.

Leave a Reply