{"id":619,"date":"2016-03-10T23:30:01","date_gmt":"2016-03-10T14:30:01","guid":{"rendered":"http:\/\/labo.samuraistyle.org\/blog\/?p=619"},"modified":"2016-10-22T18:06:41","modified_gmt":"2016-10-22T09:06:41","slug":"pdo%e3%81%ae%e3%83%97%e3%83%aa%e3%83%9a%e3%82%a2%e3%83%89%e3%82%b9%e3%83%86%e3%83%bc%e3%83%88%e3%83%a1%e3%83%b3%e3%83%88%e3%81%a7%e5%ae%9f%e8%a1%8c%e3%81%97%e3%81%9fsql%e3%82%92%e7%a2%ba%e8%aa%8d","status":"publish","type":"post","link":"https:\/\/labo.samuraistyle.org\/blog\/archives\/619","title":{"rendered":"PDO\u306e\u30d7\u30ea\u30da\u30a2\u30c9\u30b9\u30c6\u30fc\u30c8\u30e1\u30f3\u30c8\u3067\u5b9f\u884c\u3059\u308bSQL\u3092\u78ba\u8a8d\u3057\u305f\u3044(?\u30d7\u30ec\u30fc\u30b9\u30db\u30eb\u30c0\u306e\u5834\u5408)"},"content":{"rendered":"<p>\u30e2\u30c0\u30f3\u306a\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u4f7f\u3063\u3066\u3044\u308c\u3070\u3053\u3093\u306a\u3053\u3068\u3067\u56f0\u308b\u3053\u3068\u3082\u306a\u3044\u3093\u3060\u308d\u3046\u3051\u3069\u3001\u30ec\u30ac\u30b7\u30fc\u306a\u30aa\u30ec\u30aa\u30ec\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306e\u9762\u5012\u3092\u898b\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3053\u3068\u3082\u3042\u308b\u3088\u306d\u3002<\/p>\n<p>\u305d\u3093\u306a\u6642\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u3084\u308b\u3057\u304b\u306a\u3044\u3093\u3058\u3083\u306a\u3044\u304b\u306a\u3002<\/p>\n<p><!--more--><\/p>\n<pre><code>$values = array('123', '2016-03-10 00:00:00');\n$sql = 'SELECT * FROM tablename WHERE id = ? AND create_date < ?';\n$sql = vsprintf(str_replace('?', '%s', $sql), $values);\necho $sql;<\/code><\/pre>\n<p>\u3042\u3068\u306f\u307e\u3041\u6587\u5b57\u5217\u3092\"\"\u3067\u56f2\u3093\u3060\u308a\u3001\u4e88\u7d04\u8a9e\u306f\u56f2\u308f\u306a\u3044\u3088\u3046\u306b\u3057\u305f\u308a\u3059\u308c\u3070\u5927\u4e08\u592b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30e2\u30c0\u30f3\u306a\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u4f7f\u3063\u3066\u3044\u308c\u3070\u3053\u3093\u306a\u3053\u3068\u3067\u56f0\u308b\u3053\u3068\u3082\u306a\u3044\u3093\u3060\u308d\u3046\u3051\u3069\u3001\u30ec\u30ac\u30b7\u30fc\u306a\u30aa\u30ec\u30aa\u30ec\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306e\u9762\u5012\u3092\u898b\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3053\u3068\u3082\u3042\u308b\u3088\u306d\u3002 \u305d\u3093\u306a\u6642\u306f\u3053\u3093\u306a\u611f\u3058\u3067\u3084\u308b\u3057\u304b\u306a\u3044\u3093\u3058\u3083\u306a\u3044\u304b\u306a\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3],"tags":[6],"class_list":["post-619","post","type-post","status-publish","format-standard","hentry","category-tech","tag-php"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/labo.samuraistyle.org\/blog\/wp-json\/wp\/v2\/posts\/619","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/labo.samuraistyle.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/labo.samuraistyle.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/labo.samuraistyle.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/labo.samuraistyle.org\/blog\/wp-json\/wp\/v2\/comments?post=619"}],"version-history":[{"count":6,"href":"https:\/\/labo.samuraistyle.org\/blog\/wp-json\/wp\/v2\/posts\/619\/revisions"}],"predecessor-version":[{"id":912,"href":"https:\/\/labo.samuraistyle.org\/blog\/wp-json\/wp\/v2\/posts\/619\/revisions\/912"}],"wp:attachment":[{"href":"https:\/\/labo.samuraistyle.org\/blog\/wp-json\/wp\/v2\/media?parent=619"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/labo.samuraistyle.org\/blog\/wp-json\/wp\/v2\/categories?post=619"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/labo.samuraistyle.org\/blog\/wp-json\/wp\/v2\/tags?post=619"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}