-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistele.php
53 lines (45 loc) · 888 Bytes
/
listele.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
require "baglan.php";
$sorgu = $db->prepare("Select * from kisiler");
$sorgu->execute();
$kisiler = $sorgu->fetchAll();
// var_dump($kisiler);
echo '
<table border="1">
<tr>
<td>ID</td>
<td>Yaşı</td>
<td>Cinsiyeti</td>
<td>Adı</td>
<td>Soyadı</td>
<td>Şehri</td>
<td>Düzenle</td>
<td>Sil</td>
</tr>
';
foreach($kisiler AS $kisi){
$sorgu2 = $db->prepare("Select * from iller WHERE id = ? ");
$sorgu2->execute(array($kisi[5]));
$il = $sorgu2->fetch();
// var_dump($il);
echo "
<tr>
<td>$kisi[0]</td>
<td>$kisi[1]</td>
<td>$kisi[2]</td>
<td>$kisi[3]</td>
<td>$kisi[4]</td>
<td>
$il[ilinadi]
</td>
<td>
<a href='duzenle.php?id=$kisi[0]'>düzenlemek için tıklayın</a>
</td>
<td>
<a href='sil.php?id=$kisi[0]'>silmek için tıklayın</a>
</td>
</tr>
";
}
echo "</table>";
?>