Created
March 5, 2013 09:58
-
-
Save coudenysj/5089198 to your computer and use it in GitHub Desktop.
A small snippet that uses Zend\Db, but should create bind placeholder in the $query->where() instead of injecting the actual value.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$sql = new \Zend\Db\Sql\Sql($db, 'user'); | |
$query = $sql->update(); | |
$query->set(array('_update' => date('Y-m-d H:i:s'))); | |
$query->where(array('userID' => 1)); | |
$stmt = $sql->prepareStatementForSqlObject($query); | |
$stmt->execute(array('userID' => 1)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/ralphschindler/Zend_Db-Examples/
http://static.zend.com/topics/ZendDb-2.pdf (slide 27)