1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

ZendFramework2、MySQLで一時テーブル作成

Last updated at Posted at 2017-08-09

ZendFramework2、MySQLで一時テーブルを使いたかったため、
調べてみたらできた話。

$dbAdapterをアダプターとして、

$sql ... テーブルを定義するSELECT文

$dbAdapter->query(
'create temporary table temp_table_name ' . $sql,
$dbAdapter::QUERY_MODE_EXECUTE);

としたらできた。

DDLを使うにはqueryメソッドの第二引数に$dbAdapter::QUERY_MODE_EXECUTEを設定しないとダメっぽい(未確認)。

おわり。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?