Şimdi Ara

PHP Mysql ile <TD> halinde birden fazla veri çekme

Daha Fazla
Bu Konudaki Kullanıcılar: Daha Az
2 Misafir - 2 Masaüstü
5 sn
3
Cevap
1
Favori
129
Tıklama
Daha Fazla
İstatistik
  • Konu İstatistikleri Yükleniyor
0 oy
Öne Çıkar
Sayfa: 1
Giriş
Mesaj
  • Bir eczane sitesi yapıyorum veritabanındaki kişileri doktor sorguladığında MySQL'den veriyi cekiyor fakat, aynı isimde olan kişilerin hepsini cıkarmıyor SQL'deki en üstteki kişiyi alıyor bir alta gecip diğer sonucları göstermesi gerekirken ilk sonucu alıyor yardım edebilir misiniz? Yardımcı olursanız cok sevinirim.


    Bkz; https://www.hizliresim.com/cqredrr


    Kod:

    if (isset($_POST)){

    $noadi = $_POST["ADI"];


    $bul = "SELECT * FROM veriler where ADI='$noadi' and SOYADI='$nosoyad'";

    $kayit = $conn->query($bul);

    }


    <?PHP

    İf ($kayitadi->num_rows>0) {

    While ($satir = $kayitadi->fetch_assoc()){

    $Tc = $satir['TC'];

    $Adi = $satir['ADI'];

    $Soyadi = $satir['SOYADI'];

    $Anaadi = $satir['ANAADI'];

    $Babaadi = $satir['BABAADI'];

    $Dogumyeri = $satir['DOGUMYERI'];

    $Dogumtarihi = $satir['DOGUMTARIHI'];

    $Cinsiyeti = $satir['CINSIYETI'];

    $Nufusili = $satir['NUFUSILI'];

    $Nufusilcesi = $satir['NUFUSILCESI'];

    $Adresil = $satir['ADRESIL'];

    $Adresilce = $satir['ADRESILCE'];

    $Mahalle = $satir['MAHALLE'];

    $Cadde = $satir['CADDE'];

    $Kapino = $satir['KAPINO'];

    $Daireno = $satir['DAIRENO'];

    }

    }

    ?>


    <Table ID="Zero-conf" class="table table-hover" style="width: 100%">

    <Thead>

    <Tr>

    <Th>kimlik no</th>

    <Th>adı</th>

    <Th>soyadı</th>

    <Th>cinsiyeti</th>

    <Th>ana adı</th>

    <Th>baba adı</th>

    <Th>doğum yeri</th>

    <Th>doğum tarihi</th>

    <Th>nüfus il</th>

    <Th>nüfus ilçe</th>

    <Th>adres il</th>

    <Th>adres ılçe</th>

    <Th>mahalle</th>

    <Th>cadde</th>

    <Th>kapı no</th>

    <Th>daire no</th>

    </Tr>

    </Thead>

    <Tbody ID="jojjoojj">

    <Tr>

    <Td><?PHP echo $tc?></td>

    <Td><?PHP echo $adi?></td>

    <Td><?PHP echo $soyadi?></td>

    <Td><?PHP echo $anaadi?></td>

    <Td><?PHP echo $babaadi?></td>

    <Td><?PHP echo $dogumyeri?></td>

    <Td><?PHP echo $dogumtarihi?></td>

    <Td><?PHP echo $cinsiyeti?></td>

    <Td><?PHP echo $nufusili?></td>

    <Td><?PHP echo $nufusilcesi?></td>

    <Td><?PHP echo $adresil?></td>

    <Td><?PHP echo $adresilce?></td>

    <Td><?PHP echo $mahalle?></td>

    <Td><?PHP echo $cadde?></td>

    <Td><?PHP echo $kapino?></td>

    <Td><?PHP echo $daireno?></td>

    </Tr>

    </Tbody>

    </Table>








  • <?PHP


    İf ($kayitadi->num_rows>0) {


    While ($satir = $kayitadi->fetch_assoc()){


    $Tc = $satir['TC'];


    $Adi = $satir['ADI'];


    $Soyadi = $satir['SOYADI'];


    $Anaadi = $satir['ANAADI'];


    $Babaadi = $satir['BABAADI'];


    $Dogumyeri = $satir['DOGUMYERI'];


    $Dogumtarihi = $satir['DOGUMTARIHI'];


    $Cinsiyeti = $satir['CINSIYETI'];


    $Nufusili = $satir['NUFUSILI'];


    $Nufusilcesi = $satir['NUFUSILCESI'];


    $Adresil = $satir['ADRESIL'];


    $Adresilce = $satir['ADRESILCE'];


    $Mahalle = $satir['MAHALLE'];


    $Cadde = $satir['CADDE'];


    $Kapino = $satir['KAPINO'];


    $Daireno = $satir['DAIRENO'];


    // BUNLARI BÖYLE YAPARSAN AYNI DEĞİŞKENE DÖNGÜYLE SIRAYLA VERİ YAZARSIN, EN SON ELİNDE TEK VERİ OLUR. BU NEDENLE ARRAY KULLANMALISIN.


    ÖR:


    $Tc = array();

    $Adi = array();


    $Tc[] = $satir['TC'];

    $Adi[] = $satir['ADI'];



    }


    }


    ?>




    <Table ID="Zero-conf" class="table table-hover" style="width: 100%">


    <Thead>


    <Tr>


    <Th>kimlik no</th>


    <Th>adı</th>


    <Th>soyadı</th>


    <Th>cinsiyeti</th>


    <Th>ana adı</th>


    <Th>baba adı</th>


    <Th>doğum yeri</th>


    <Th>doğum tarihi</th>


    <Th>nüfus il</th>


    <Th>nüfus ilçe</th>


    <Th>adres il</th>


    <Th>adres ılçe</th>


    <Th>mahalle</th>


    <Th>cadde</th>


    <Th>kapı no</th>


    <Th>daire no</th>


    </Tr>


    </Thead>


    <Tbody ID="jojjoojj">


    <Tr>


    <Td><?PHP echo $tc?></td>


    <Td><?PHP echo $adi?></td>


    <Td><?PHP echo $soyadi?></td>


    <Td><?PHP echo $anaadi?></td>


    <Td><?PHP echo $babaadi?></td>


    <Td><?PHP echo $dogumyeri?></td>


    <Td><?PHP echo $dogumtarihi?></td>


    <Td><?PHP echo $cinsiyeti?></td>


    <Td><?PHP echo $nufusili?></td>


    <Td><?PHP echo $nufusilcesi?></td>


    <Td><?PHP echo $adresil?></td>


    <Td><?PHP echo $adresilce?></td>


    <Td><?PHP echo $mahalle?></td>


    <Td><?PHP echo $cadde?></td>


    <Td><?PHP echo $kapino?></td>


    <Td><?PHP echo $daireno?></td>


    </Tr>


    // BU ŞEKİLDE YAPARSAN TEK SATIR GÖSTERİRSİN. ÜSTTE ARRAYA DOLDURDUĞUN VERİLERİ DÖNGÜYE SOKUP TABLOYU SATIR SATIR GÖSTERMEN GEREK.


    ÖR:

    for($i = 0; $i<count($Tc); $i++)

    {

    ?>

    <tr>

    <td><?=$Tc[$i];?></td>

    <td><?=$Adi[$i];?></td>

    </tr>

    <?

    }


    </Tbody>


    </Table>





  • 
Sayfa: 1
- x
Bildirim
mesajınız kopyalandı (ctrl+v) yapıştırmak istediğiniz yere yapıştırabilirsiniz.