<?php
// Veritabanından bölüm ve kategori eşleşmelerini çekiyoruz
$sql = "SELECT sections.section_id, sections.section_title, categories.category_name
FROM sections
INNER JOIN category_sections ON sections.section_id = category_sections.section_id
INNER JOIN categories ON categories.category_id = category_sections.category_id";
$query = $this->db->prepare($sql);
$query->execute();
$data = $query->fetchAll(PDO::FETCH_ASSOC);
// Bölümleri ve kategorileri organize etmek için bir dizi oluşturuyoruz
$sections = [];
foreach ($data as $row) {
$section_id = $row["section_id"];
if (!isset($sections[$section_id])) {
$sections[$section_id] = [
"section_title" => $row["section_title"],
"categories" => []
];
}
$sections[$section_id]["categories"][] = $row["category_name"];
}
?>
<!-- Sections - Bölümler -->
<?php foreach ($sections as $section) : ?>
<h1><?php echo $section["section_title"]; ?></h1>
<table>
<thead>
<tr>
<th>Kategori Adı</th>
</tr>
</thead>
<tbody>
<!-- Categories - Kategoriler -->
<?php foreach ($section["categories"] as $category_name) : ?>
<tr>
<td><?php echo $category_name; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endforeach; ?>
<!-- Sections - Bölümler Bitiş -->
// Veritabanından bölüm ve kategori eşleşmelerini çekiyoruz
$sql = "SELECT sections.section_id, sections.section_title, categories.category_name
FROM sections
INNER JOIN category_sections ON sections.section_id = category_sections.section_id
INNER JOIN categories ON categories.category_id = category_sections.category_id";
$query = $this->db->prepare($sql);
$query->execute();
$data = $query->fetchAll(PDO::FETCH_ASSOC);
// Bölümleri ve kategorileri organize etmek için bir dizi oluşturuyoruz
$sections = [];
foreach ($data as $row) {
$section_id = $row["section_id"];
if (!isset($sections[$section_id])) {
$sections[$section_id] = [
"section_title" => $row["section_title"],
"categories" => []
];
}
$sections[$section_id]["categories"][] = $row["category_name"];
}
?>
<!-- Sections - Bölümler -->
<?php foreach ($sections as $section) : ?>
<h1><?php echo $section["section_title"]; ?></h1>
<table>
<thead>
<tr>
<th>Kategori Adı</th>
</tr>
</thead>
<tbody>
<!-- Categories - Kategoriler -->
<?php foreach ($section["categories"] as $category_name) : ?>
<tr>
<td><?php echo $category_name; ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
<?php endforeach; ?>
<!-- Sections - Bölümler Bitiş -->`
Bu verileri çekti ama
css leri uygulamadı bide
şu kodda DESC olarak ayarlamışım ama te yani son id benim 68 ana sayfada ondan
sonra küçük olanları diyorum 1 den başlayıp 67 e kadar gidiyor
tam tersi yapınca da bu sefer 77 den başlıyor son id 10 ama 77 den başlıyor
$row = $db->query('SELECT * FROM user WHERE id > '.$_POST["lastID"].' ORDER BY id ASC LIMIT '.$_POST["start"].','.$_POST["limit"].'')->fetchAll(PDO::FETCH_ASSOC);
Tamamdır Allah kabul etsin
Veri yükleniyor sıkıntı yok
ama html çıktı veriyor
intersecction observer ile loadMore
Bütün kodları ataiblirim.
O bu goruntuyu ajax tarafinda mi yakalayip ekrana basmam lazim
https://www.r10.net/php/974408-bir-formu-iki-sayfaya-post-etmek.html
Hiç denemedim ama belki olur.
aşağıdaki işini görmezse sorgularını şu şekilde düzenlersin
if ( $query ){
// varsa yapılacak işlemler
}
else{
// yoksa yapılacak işlemler
}
bunu böyle yaparsan basicdb hatası gider ama yerine PDO hatası gelir onun içinde ya
error_reporting(0) dersin
private function showError(PDOException $error, $status = false)
{
if(!$status === false){
$this->errorTemplate($error->getMessage());
}
return false;
}
let hasName = (this.isActive === 1) ? "disabled" : "";
$data.append('<option '+hasName+' value='+ this.id + '>' + this.saatler + '</option>'
açık ama fazla takma kullan fazla takma kullan gitsin
sonra bi sorun olursa lisans alirsin.