2つの異なるテーブルから情報を取得するPDOリクエストを実行したいのですが、物事はすぐに難しくなります.
次のように編成された最初のデータベーステーブル(花)があります(ただし、表示するものよりも本当に大きいです):
ID; name; price of format 1; price of format 2; name of other format 3; price of other format 3;
FLOW0001; big yellow flower; ; 15,99; more big format; 34,99;
FLOW0002; little red flower; 5,99; 8,99; ; ;
・・・こんな感じで続きます・・・
2 番目のテーブル (ツリー) は次のようになります。
ID; name; name of format; price of format;
TREE0001; OMG BIG TREE !; F*** big format; 599,99;
TREE0001; OMG BIG TREE !; F*** even bigger format; 899,99;
TREE0002; litte ugly tree; little format; 20,99;
・・・こんな感じで続きます・・・
問題は、これらの 2 つのテーブルを「マージ」して、次のようなページにブレンドして表示したいということです。
while ($datas =$response->fetch()) //fetching the tables, they will be togheter and ordered by (their biggest) price. So, trees and flowers will blend.
{
// then echo the fetched datas. I will need to separate the prices and show them... some if/else based on pregmatches of the ID to know if it's an TREE or FLOW.
}
これをブレンドする方法は?アイデアがありません。最悪なのは、ページ システム (1 ページあたり 50) を作成する必要があることです。ページ システム上およびページ内で、複製されたすべてのツリーが唯一のツリーとして表示される必要があります... ヘルプ !