<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>takuya_1st</author_name>
  <author_url>https://blog.hatena.ne.jp/takuya_1st/</author_url>
  <blog_title>それマグで！</blog_title>
  <blog_url>https://takuya-1st.hatenablog.jp/</blog_url>
  <categories>
  </categories>
  <description>PDOのquery/execの違いを忘れていたので、久しぶりに調べてみた。 &lt;?php $ret = $this-&gt;album_table-&gt;exec($CREATE_TABLE_SQL); $ret = $this-&gt;album_table-&gt;query($CREATE_TABLE_SQL); 複数行のクエリを投げるときは、execを使う。たとえばcreate tableの一括実行など。sqlite:memory:で動作確認した。queryだと最初の一行だけが実行されただけだった。 exec 複数行まとめて実行 query 一行実行 queryは複数仕込んでも一行だけだった。</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftakuya-1st.hatenablog.jp%2Fentry%2F20120302%2F1330710800&quot; title=&quot;PDOのquery/execの違い - それマグで！&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2012-03-02 02:53:20</published>
  <title>PDOのquery/execの違い</title>
  <type>rich</type>
  <url>https://takuya-1st.hatenablog.jp/entry/20120302/1330710800</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
