13. <?php $keyword = ''; if (isset($_POST['keyword'])) { $keyword = $_POST['keyword']; } mysql_connect('localhost','user','password'); mysql_select_db('cakephp_sample'); mysql_query('set names utf8'); $sql = sprintf( "SELECT id,name,description FROM friends WHERE name LIKE '%s'", mysql_real_escape_string('%'.$keyword.'%') ); $result = mysql_query($sql); $data = array(); while ($row = mysql_fetch_a
![3時間濃縮CakePHP2.1 in PHPカンファレンス北海道2012](https://cdn-ak-scissors.b.st-hatena.com/image/square/e16050107ba3ee1103fedf328048863e52e4d51e/height=288;version=1;width=512/https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2F20120421cakephp-120507210532-phpapp02-thumbnail.jpg%3Fwidth%3D640%26height%3D640%26fit%3Dbounds)