Arama butonu
Bu konudaki kullanıcılar: 1 misafir
1
Cevap
194
Tıklama
0
Öne Çıkarma
PHP Mysql ile <TD> halinde birden fazla veri çekme
A
3 yıl
Er
Konu Sahibi

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>

DH forumlarında vakit geçirmekten keyif alıyor gibisin ancak giriş yapmadığını görüyoruz.

Üye olduğunda özel mesaj gönderebilir, beğendiğin konuları favorilerine ekleyip takibe alabilir ve daha önce gezdiğin konulara hızlıca erişebilirsin.

Üye Ol Şimdi Değil



T
3 yıl
Binbaşı

<?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>



DH Mobil uygulaması ile devam edin. Mobil tarayıcınız ile mümkün olanların yanı sıra, birçok yeni ve faydalı özelliğe erişin. Gizle ve güncelleme çıkana kadar tekrar gösterme.