You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
A while ago, I answered on this SO question about using 2 database connections. In answering that, I did some investigation which I'll write up here. Here is how to run more than one database connection. This article is about using databases with different data, not necessary for load balancing (or connection pooling) between databases. Define Connections Inside of your datbase configuration file
こちらも全レコードを取得するには、条件を付けずにそのままget()します。 $results = DB::table('apple_orders')->get(); $resultsの結果も、上記のテーブル構造をそのままstdClassのプロパティーにし、全件分レコードが配列になります。でも、せっかくりんごマスターがあるのですから、やっぱり数字のりんごIDでなくて、人間が読めるりんご名をレコードに含みたいですよね。 LEFT JOINでマスターを引っ張ってきましょう。レコードに名前を含めましょう。 $results = DB::table( 'apple_orders' ) ->leftJoin( 'apples', 'apple_orders.apple_id', '=', 'apples.id' ) ->select([ '*', 'apple_orders.created_at as
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く