码迷,mamicode.com
首页 > Web开发 > 详细

PHP pdao用法总结

时间:2016-04-28 20:12:59      阅读:500      评论:0      收藏:0      [点我收藏+]

标签:

$sql = ‘SELECT name, colour, calories
    FROM fruit
    WHERE calories < :calories AND colour = :colour‘;
$sth $dbh->prepare($sqlarray(PDO::ATTR_CURSOR => PDO::CURSOR_FWDONLY));
$sth->execute(array(‘:calories‘ => 150, ‘:colour‘ => ‘red‘));
$red $sth->fetchAll();
$sth->execute(array(‘:calories‘ => 175, ‘:colour‘ => ‘yellow‘));
$yellow $sth->fetchAll();

 

1
2
3
4
5
6
7
$sth $dbh->prepare(‘SELECT name, colour, calories
    FROM fruit
    WHERE calories < ? AND colour = ?‘);
$sth->execute(array(150, ‘red‘));
$red $sth->fetchAll();
$sth->execute(array(175, ‘yellow‘));
$yellow $sth->fetchAll();

总结地址:http://www.cnblogs.com/pinocchioatbeijing/archive/2012/03/20/2407869.html

PHP pdao用法总结

标签:

原文地址:http://www.cnblogs.com/as3lib/p/5443946.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!