开发者

Specifying a db function in an insert statement in Zend

I have something like this:

$data = array('use开发者_开发技巧rname' => 'John', 'password' => 'john123');
$table = new Zend_Db_Table('users');
$table->insert($data);

But I want it to include a hashing function to the password, so the sql is something like this:

INSERT INTO `users` (`username`, `password`) VALUES ('John', PASSWORD('john123'));

How can I do that, elegantly?


$data = array('username' => 'John', 'password' => new Zend_Db_Expr('SHA1(john123)');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜