Iki tablo ile bir mantıksal bir sorun

0 Cevap php

Hey guys, demirbaşlar için bir liste oluşturduk.

$result = mysql_query("SELECT date FROM ".TBL_FIXTURES." WHERE compname = '$comp_name' GROUP BY date");
    $i = 1;
    $d = "Start";
    while ($row = mysql_fetch_assoc($result)) 
    {
        $odate = $row['date'];
        $date=date("F j Y", $row['date']);
        echo "<p>Fixture $i - $d to $date</p>";
    }

As you can see from the query, the date is displayed from the fixtures table. The way my system works is that when a fixture is "played", it is removed from this table. Therefore when the entire round of fixtures are complete, there wont be any dates for that round in this table. They will be in another table.

Zaten ben aynı zamanda tarih boyunca başka bir sorgu çalıştırmak ve sonuçları tablodaki bir tarih yoksa fikstür tablodan yalnızca tarihleri ​​görüntüleyebilirsiniz var mı?

"SELECT * FROM ".TBL_CONF_RESULTS." 
                               WHERE compid = '$_GET[id]' && type2 = '2' ORDER BY date" 

Yani ikinci sorgu olurdu!

DÜZENLEME BURAYA SONRASI GELEN ...

Zaten ben iki tablodaki tarih seçebilir ve maçı varsa o zaman sadece birini kullanmak var. Sonra benim sorgu doldurmak için tarihler (BY GRUPLU) satırları kullanılır? Bu mümkün mü?

0 Cevap